Program #34: Program to check number is odd or even using conditional operator
C Language
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("Enter one number = ");
scanf("%d",&n);
n%2==0?printf("Even number"):printf("Odd number");
getch();
}
/*OUTPUT*/
Enter one number = 9
Odd number