Write a program in C++ to scan a number and identify whether it is even number of odd

Write a program in C++ to scan a number and identify whether it is even number of odd
 # include <iostream>
using namespace std;
int main(){
       int a, b;
       cout << "Enter Number" << endl;
       cin >> a;
       b = a % 2;
       if(b==0){
              cout <<" Number is Even" << endl;
       }
       else
       {
              cout << "Number is odd" << endl;
       }
       system("Pause");
       return 0;
}


Comments