Tuesday, 25 February 2014

Tagged Under:

Program to find whether a number is even or odd

Share
This Program checks whether the entered number is even or odd...
Any integer is input through the keyboard.
Source Code
#include<stdio.h>
main()
{

int num;

printf ("Enter a number to be checked for even/odd: ");
scanf ("%d",&num);

if (num%2==0)
{
printf ("The entered number is EVEN.\n");

}
else
{
printf ("The entered number is ODD.\n");

}
}


Output


0 comments:

Post a Comment

Contact Us

Want to ask anything? Be our guest, give us a message.

Name Email * Message *