Aim :- Write a C++ Program To Check Whether Number is Odd or Even.
C++ program to For Checking Whether Number is Odd or Even.
Definitions :
Even Number : Integers which are perfectly divisible by 2 are called even numbers.
Odd Number : Integers which are not perfectly divisible by 2 are not known as odd number.
C++ Program Code :
#include<stdio.h>
#include<iostream.h>
void main()
{
int n;
clrscr();
cout << "\nC++ Program To Check Whether Number is Odd or Even.";
cout << "\n\nEnter The Number : ";
cin >> n;
if ( n % 2 == 0)
{
cout << n << " is Even Number.";
}
else
{
cout << n << " is Odd Number.";
}
getch();
}
Output :
0 Comments