// Program 3: EvenOdd.C // (c) Burt Rosenberg 1996 // This program introduces the if/else statement. #include void main() { // Create an integer variable. int num ; // Get the number cout << "Enter a number: " ; cin >> num ; // Test the number and print the result if ( (num%2) == 0 ) { // The number is even cout << num << " is even" << endl ; } else { // The number is odd cout << num << " is odd" << endl ; } }