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
#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