A program to find whether the number entered by the user is even or odd.

 

#include<iostream.h>
#include<conio.h>

void main()
{
clrscr();
int n;

cout<<"Enter a number: ";
cin>>n;

if(n%2==0)
cout<<"\nThe number is even.";
else
cout<<"\nThe number is odd.";

getch();
}

 

 

< Back