This is a C program which implements the conditional operators usage. Generally a conditional operator is one which has one condition and 2 results for condition true and condition false. |
PROGRAM :
#include <stdio.h> #include <stdlib.h> int main() { int num1,num2,e; printf("Enter any number:\t"); scanf("%d",&num1); printf("Enter another number :\t"); scanf("%d",&num2); e = (num1 > num2) ? num1: num2; printf("%d is the greatest of two",e); return 0; }OUTPUT :