C Programming Code Examples C > Beginners Lab Assignments Code Examples check even or odd number using conditional operator check even or odd number using conditional operator Write a C program to input a number and check whether number is even or odd using Conditional/Ternary operator ?:. How to check even or odd numbers using conditional operator in C program. #include <stdio.h> int main() { int j; /* Input a number from user */ printf("Enter any number to check even or odd: "); scanf("%d", &j); /* * If n%2==0 then * print it is even * else * print it is odd */ (j%2 == 0) ? printf("The number is EVEN") : printf("The number is ODD"); return 0; }