Wednesday 11 July 2012

Conditional statement006

Any integer is input through the keyboard. Write a program to find out whether it is an odd number or even number. 



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

void main( )
{
int n;
clrscr ( );

printf ("\n Enter any number.....:"); scanf ("%d",&n);

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


To contact us

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...