c++ Basic program: Finding even or odd number.

Posted on at


 Finding even or odd number

 

This program will show you how you can find a number weather it is even or odd.

#include<iostream.h>

#include<conio.h>

int main()

{

int num;

cout<<"Enter any number="<<endl;

cin>>num;

 

if(num%2==0)

        cout<<"Number is even."<<endl;

 

if (num%2!==0)

      cout<<"Number is odd."<<endl;

getch();

return 0;

}

 

OutPut:

Enter any number=25

Number is odd.

********************************************************************************************************************



About the author

noshaba-bibi

I am Noshaba Bibi ,24 years old ,
done Mcs from Virtual university and I am a blogger.

Subscribe 0
160