Program # 4: Given number is Odd or Even
//Program to find out the given number is odd or even (Level - Low)
#include <iostream.h>
#include <conio.h>
void main
()
{
clrscr ();
int a;
cout<<"Enter the number
= ";
cin >> a;
if
(a% 2 == 0) //% is used to calculate the remainder
cout<<"The
number is even";
else
cout<<"The
number is odd";
getch ();
}
0 Comments