Header Ads Widget

Responsive Advertisement

Program to Check Odd or Even Using the Ternary Operator



#include<stdio.h>

int main()

{

int num;

printf("Enter the number :");

scanf("%d",&num);


(num %2 ==0) ? printf("Number is Even \n ") : printf("Number is odd \n");

return 0;

}

Post a Comment

0 Comments