/* * @topic T00230 arithmetic if operator, aka conditional if * @brief calculate parity of an int */ #include <iostream> int main( ) { // Declare a variable int number = 0; // Get user input std::cout << "Please enter a number: "; std::cin >> number; // Find out parity and print result std::cout << "The number is "; std::cout << ( ( number % 2 ) ? "odd" : "even" ); // condition? true false //loop std::cout << ( ( number % 10 ) ? "" : "=" ); return 0; }