Sunday, March 17, 2013

Checking Even Or Odd

#include<iostream>
using namespace std;
int main()
{
    int a;
    cout<<"Enter a number:";
    cin>>a;
    if(a%2==0)
    cout<<"Result:Even";
    else
    cout<<"Result:Odd";
    return 0;
}

0 comments:

Post a Comment