Saturday, December 31, 2011

Check whether a given number is even or odd in 'C'

Example



#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
clrscr();
printf("Enter a no:");
scanf("%d",& n);
printf("\n=================ODD && EVEN=================\n");
if(n%2==0)
{
printf("\nNumber is even");
}
else
{
printf("\nNumber is odd");
}
getch();
}
/*=======================OUTPUT===========================
Enter a no:2
Number is even
=============================================================*/

1 comment:

  1. Best Casino Sites in the Philippines | LuckyClub
    The only real competition is with a deposit bonus, so you can try your luck on the slots at the casino luckyclub.live site. Lucky Club is a great example of a

    ReplyDelete