/* program to find a no is even or odd */
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int e;
cout<<"Enter a no :"<<endl;
cin>>e;
if (e==0)
cout<<"The no is neither even or odd "<<endl;
if (e%2==0)
cout<<"The no is even"<<endl;
else
cout<<"The no is odd "<<endl;
getch();
}
Not Satisfied ? Just search & get the result
Related posts:
- Sample – Program to enter an integer and find out if it is even or odd.
- C program to check whether a given integer is odd or even
- Sample – Program to enter a sentence and output the number of uppercase & lowercase consonants, uppercase & lowercase vowels in sentence..
- C program to find the frequency of odd numbers and even numbers in the input of a matrix
- C program to find the sum of odd numbers and sum of even numbers from 1 to N. Output the computed sums on two different lines with suitable headings
