Header Ads

Header ADS

EVEN OR ODD NUMBER IN C++

#include <iostream>

using namespace std;

int main ()

{

    int num;

    cout<<"PLEASE ENTER A INTEGER NUMBER : ";

    cin>>num;

    if (num % 2 == 0)

    {

        cout<<num<<" THIS IS A EVEN NUMBER"<<endl;

    }

    else

    {

        cout<<num<<" THIS IS A ODD NUMBER"<<endl;

    }

    return 0;

}
OUTPUT


No comments

Powered by Blogger.