Wednesday, 8 July 2015

Even/Odd in c++

#include<iostream>
using namespace std;
int main()
{
int a;
cout<<"enter a num: ";
cin>>a;

if(a%2==0){
cout<<"Num is even\n";
}else
cout<<"Num is odd\n";

return 0;
}

0 comments:

Post a Comment