answersLogoWhite

0


Best Answer

Something like this:

if number % 2 == 0

---print "even"

else

---print "odd"

Or:

print (number % 2) ? "even" : "odd"

Notes:

  • The above is pseudocode; you'll have to adapt to your specific language.
  • The "---" were added instead of spaces.
  • The "%" operator is used to calculate the remainder of a division. It is the easiest way to figure out whether a number is a multiple of another number.
  • The ternary operator "?" and ":" is available in many languages based on C (including Java); it can often be used as a convenient shorthand for an "if".
User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the if then statement of this an even number is divisible by two show the answer of this statement?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you know of a number is divisible by 4?

The 4 times table will show that a number is divisible by 4. Therefore, times any number, odd or even, by 4: the answer will be divisible by 4.


Any number that is divisible by 2 is also divisible by 6 Find a counterexample to show that the conjecture is false?

4 is divisible by 2 but not by 6


Show that 287 is not a prime number?

287 is divisible by 7.7x41=287


Any number that is divisible by 4 is also divisible by 8 find a counterexample to show the conjecture is false?

4 divides 4 (once), but 4 is not divisible by 8. ■


Any number that is divisible by 3 is also divisible by 9 .Find a counterexample to show that the conjecture is false?

You are an Idiot dude. there is no such value


Which divisibility rule can be used to show 585 is divisible by 3?

The divisibility rule of 3 is that you add the digits together and then if the number you come up with is divisible by 3, then the number itself is divisible by 3. In this instance, 5 + 8 + 5 = 18/3 = 6, therefore, 585 is divisible by 3.


Which number is divisible by by 10?

Every whole number that ends with a 'zero' is divisible by 10. Sorry I can't be more specific, but you've neglected to show me the list of multiple choices that you're required to choose from.


How can you show that a number is prime or not?

To show that it's NOT prime, you have to find that in addition to '1' and itself, the number has another factor.First, look for signs of obvious factors. The easy ones are 2, 3, 5, and 10.-- If the number ends in 2, 4, 6, or 8, it's an even number, meaning 2 is a factor. It's not prime, andyou can stop right there.-- If the sum of its digits is divisible by 3, then the whole number is divisible by 3. It's not prime, and you can stop.-- If the number ends in 5, it's divisible by 5. It's not prime, and you can stop.-- If the number ends in 0 (zero), it's divisible by 10. It's not prime, and you can stop.If none of these pans out, then you have to slog through it the slow way. One after another, divide thenumber by all the numbers from 2 up to half of the number. If any of the divisions comes out even, then thenumber is not prime, and you don't have to try any more divisions.


Why is 836475 not a prime number?

A number which is divisible by itself and 1 is called prime number. A prime number has only two factors.But, 836475 is also divisible by5, i.e. 836475 has more than two factors.Therefore, the given number is not prime.In order to show that given number is not prime there is no need to find all the factors, we should show that given number has more than two factors.


How do you prove 748 is divisible by 4?

The simplest way is to divide 748 by 4 and show that there is no remainder. That proves it. A longer, but more general proof is as follows: 25*4 = 100 so 100 is dividsible by 4. By the distributive property, you can show that any number of hundreds (eg 700) is divisible by 4. So, to prove that 748 is divisible by 4, it is only necessary to show that the number formed by the last two digits (48) is divisible by 4. This is easy, since 12*4 = 48. The second method is not much of an advantage with a number like 748, but it would be if you were asked to prove that 75612349248 was divisible by 4!


How can you show that 33772 is a composite number?

It's even. The only even prime number is 2.


Can you show me a 5th grade divisible answer?

the number of books in karas collection is divisible by 2,4,5,and 10 she has more than 11 books and fewer than 25 books .how many books does kara have?