C++ program – Check for Odd or Even

by Nideesh C on May 1, 2011 · 0 comments

in C++




/* 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 Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. Sample – Program to enter an integer and find out if it is even or odd.
  2. C program to check whether a given integer is odd or even
  3. Sample – Program to enter a sentence and output the number of uppercase & lowercase consonants, uppercase & lowercase vowels in sentence..
  4. C program to find the frequency of odd numbers and even numbers in the input of a matrix
  5. 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

Leave a Comment

Previous post:

Next post: