Earn while u Learn

Tips tweaks hacks on computer with C C++ VB tutorials and ways to earn money online

ad

To find out Even or Odd no. in C

This program is a very simple example of " if statement in c" Hope you try to understand the code.
Code:
__________________________________________________________
#include(stdio.h)
#include(conio.h)
main()
{
int number;
printf("Enter the number to be checked");
scanf("%d",&a);
if(a%2==0)
{
printf("\t\nThe number you provided is a Even number\n\t");
}
else
{
printf("The number you provided is a Odd number");
}
getch();
}
__________________________________________________________

0 comments:

Sign in / Join

Labels