Program to find the number is odd or even
After including the header files, creating the main function and declaring the variable, type in the following code snippet:
if ( number%2 == 0 )
cout« "Number is even";
cout« "Number is odd";
This code will first accept input from the user in the first line.
The % operator (also called modulus operator) returns the remainder when the number on the left is divided by the number on the right (2).
If the number is even the remainder is zero else it is false.
I hope that this is what you wanted.