If a whole number entered by the user is even : Mod « Language « C++






If a whole number entered by the user is even

If a whole number entered by the user is even
#include <iostream>
using namespace std;
int main(void)
{
   int num;
   cout << "Enter a whole number: ";
   cin >> num;
   if ( num % 2 == 0 )
      cout << "The number is even" << endl;
   return 0;
}

           
       








Related examples in the same category