Program to check whether the entered number is even or odd using if else
Tuesday, August 11, 2020
//Program to check whether the entered number is even or odd using if else
#include<iostream.h>
#include<conio.h>
void main()
{clrscr();
int n;
cout<<"\n Enter an Integer:";
cin>>n;
if(n%2==0)
{
cout<<n<<" Is Even ";
}
else
{
cout<<n<<" Is Odd";
}
getch();
}
#include<iostream.h>
#include<conio.h>
void main()
{clrscr();
int n;
cout<<"\n Enter an Integer:";
cin>>n;
if(n%2==0)
{
cout<<n<<" Is Even ";
}
else
{
cout<<n<<" Is Odd";
}
getch();
}
0 Comments