Pages

Friday, February 13, 2015

C program to check whether a given number is even or odd


C program to check whether a given number is even or odd

#include<stdio.h>
#include<conio.h>

void main()
{
int n;
clrscr();
printf("Enter any number:");
scanf("%d",&n);

if(n%2==0)
printf("The number is even");
else
printf("The number is odd");

getch();
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.