Powered By Blogger

07 March 2017

PROGRAM TO FIND ODD OR EVEN NUMB. USING IF....ELSE

INPUT--


#include<iostream.h>
#include<conio.h>

void main()
{
       int no;
       clrscr();
       cout<<"Enter any num: ";
       cin>>no;
       if(no%2==0)
      { 
               cout<<"Even num";
      }
      else
     {
              cout<<"Odd num";
     }
     getch();
}


OUTPUT--

Enter any num : 5
Odd num

No comments:

Post a Comment