# include <stdio.h>
# include <conio.h>
void main()
{
int num ;
clrscr() ;
printf("Enter a number : ") ;
scanf("%d", &num) ;
if(num % 2 == 0)
printf("\nThe given number is even") ;
else
printf("\nThe given number is odd") ;
getch() ;
}
RUN 1 :
~~~~~~~
Enter a number : 10
The given number is even
RUN 2 :
~~~~~~~
Enter a number : 5
The given number is odd
# include <conio.h>
void main()
{
int num ;
clrscr() ;
printf("Enter a number : ") ;
scanf("%d", &num) ;
if(num % 2 == 0)
printf("\nThe given number is even") ;
else
printf("\nThe given number is odd") ;
getch() ;
}
RUN 1 :
~~~~~~~
Enter a number : 10
The given number is even
RUN 2 :
~~~~~~~
Enter a number : 5
The given number is odd
No comments:
Post a Comment