Skip to main content

C++ : Program to check whether the entered number is odd or even

Program to check whether the entered number is odd or even


 #include <iostream>
using namespace std;

int main()

{
    int num;

    cout << "Enter any number: ";
    cin >> num;
    if (num%2 == 0)
        cout << "Number is even";
    else
        cout << "Number is odd";

    return 0;
  
}