Write a Program of Even Odd Numbers.

#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
int n;
cout<<"enter a number:"; 
cin>>n;
if(n%2==0)
{
cout<<"the number is even";
}
else
{
cout<<"the number is odd";
}

getch();
}

OUTPUT:

 

Enter a Number

 

(Visited 247 times, 1 visits today)
Share with Friends :
Written by:

One thought on “Even Odd Numbers In C++

Leave a Reply

Your email address will not be published. Required fields are marked *