Program to enter an integer and find out if it is even or odd.

Program to enter an integer and find out if it is even or odd.
  #include <iostream>
using namespace std;
int main(){
       int a;
       cout << "Enter Number" << endl;
       cin >> a;

       if (a % 2 == 0){
              cout << "Entered No. is even" << endl;
       }
       else
       {
              cout << "Entered No. is odd" << endl;
       }

       system("pause");
       return 0;

}

Comments