Write a program to find whether the given number is odd or even using conditional operator.
/* Write a program to find whether the given number
is odd or even using conditional operator.*/
#include <stdio.h>
void main()
{
int n;
printf("Enter
the number : ");
scanf("%d",&n);
printf("The
given number is %s\n",(n%2==0)?"Even":"Odd");
getch();
}
Comments
Post a Comment