(Even Numbers) Write a program that inputs a series of integers and passes them one at a
time to function isEven, which uses the modulus operator to determine whether an integer is even.
The function should take an integer argument and return true if the integer is even and false otherwisw(how to program c++_deitel & deitel)
We don't know that user how many numbers have.what we can do?
I wrote this program but I know that it hase many problem!!!!!!!!!
(I shoudn't use 'string')
using namespace std;
bool even (int);
int _tmain(int argc, _TCHAR* argv)
cout<<"Enter the numbers.";
bool even (int number)
even(number) returns true, if the number is even and false if the number is odd
so basically if(even(number)) checks if(true) or if(false)
to explain this a bit more :
1 2 3 4
commands get executed, if the statement is true. so you could write stuff like
if(1 == odd), if(100 > 10), if(-5 < 0),... all these statements are true
but to cut a long story short you can simply write if(true)