you are to prompt the user to enter an integer value, and then accept the value from the user. The program should then determine and display an appropriate message as to whether the entered integer's value was EVEN or ODD. HINT: this is a situation where the modulo (remaindering) operation may come in handy; that is, what do you get as a result of taking an integer modulo 2 (divide the number by 2 and take the remainder)?
This is the last part of the HW that I am suppose to do, but I can't seem to figure out the modulo.
Can anybody help me with this?
I think if-else statement is needed for this, since that's what we are currently learning.
Thank you
2007-02-21
13:32:34
·
6 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design