Advertisement

Search Here

Tuesday, 8 April 2014

Check Enter Number Even or Odd in C++

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
cout<<"Enter A Number To Check EVEN or ODD"<<endl;
int n;
cin>>n;
if(n%2==0)
cout<<"Even"<<endl;
if(n%2==1)
cout<<"Odd"<<endl;

getch();
}

No comments:

Post a Comment