David D
2014-03-10 11:04:47 UTC
Produce C++ function that accepts an integer argument and determines whether the passed integer is odd or even. The function returns 1 if the number is odd and returns 2 if the number is even.
Write main ( ) function that asks the user to interactively input an integer number, calls the function to determine whether the number is odd or even, and then displays the outcome as one of the two lines accordingly
The number x is odd
The number x is even
Test your program for the following data: 55 -7 44 13 0
The program should continue getting one number at a time until the user enters 0 (zero)
There should be two function at least.
logicn -->
( integer % 2 == 0 ) for even
else
odd