C Program Check Number Is Even Or Odd Using Condition Operator :
//C Program Check Number Is Even Or Odd Using Condition Operator
#include<stdio.h>
#include<conio.h>
void main()
{
int num;
clrscr();
printf("\n Enter the value:- ");
scanf("%d",&num);
num%2==0?printf("\n The Value is EVEN"):printf("\n The Value is ODD");
getch();
}
OUTPUT#include<stdio.h>
#include<conio.h>
void main()
{
int num;
clrscr();
printf("\n Enter the value:- ");
scanf("%d",&num);
num%2==0?printf("\n The Value is EVEN"):printf("\n The Value is ODD");
getch();
}
No comments:
Post a Comment