#include <iostream>
usingnamespace std;
bool isEven(int);
int main()
{
int val;
cout << "Tell me a number and I'll tell you if it's even or odd: ";
cin >> val;
if (isEven(val))
cout << val << " is an even number.";
else
cout << "\n\n" <<val << " is an even odd.";
return 0;
}
bool isEven(int number)
{
bool status;
if (number % 2 == 0)
status = true;
else
status = false;
return status;
}
#include <iostream>
usingnamespace std;
bool isEven(int);
int main()
{
int val;
cout << "Tell me a number and I'll tell you if it's even or odd: ";
cin >> val;
if (isEven(val))
cout << val << " is an even number.";
else
cout << "\n\n" <<val << " is an odd.";//see it was so simple
return 0;
}
bool isEven(int number)
{
bool status;
if (number % 2 == 0)
status = true;
else
status = false;
return status;
PS: did I just answered a question without using my brain??? :D :D :D