Even and Odd Numbers

#include "stdafx.h"
#include "iostream"
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
       int x;
       cout << " Enter an integer: " << "\n";
       cin >> x;
       if(x%2==0)
             cout << "The number " << x << " is even." << endl;
       else
             cout << "The number " << x << " is odd." << endl;
       system("pause");
       return 0;
}




Share on Google Plus