I must admit I laughed when you said 10 will always be an even number. You're absolutely correct but you failed to realized 10 was only used as an example. Do you think your program will work if f was equal to 11? The other examples work no matter what number is sent as the parameter.
Complete this program in just one line. It tells the user whether a number is even or odd.
No use of the Mod(%) operator
no use of functions
no use of classes
no use of / * - +
a line is counted by the amount of semicolons used. so your return statement counts as one line
you cannot alter any other line in the code
using namespace std;
bool isEven(int f)
//one line here
int main (int argc, char * argv)
int f = 10;
cout << f << ( isEven(f) ? " is even" : " is odd" ) << endl;