Find Largest of Two Numbers Ternary Operator
#include<stdio.h> int main() { int num1, num2; printf("Enter First Number="); scanf("%d", &num1); printf("Enter 2nd Number="); scanf("%d", &num2); if(num1 == num2) printf("First Number %d is equal to Second Number %d ", num1,num2); else printf("First Number %d is not equal to Second Number %d ", num1,num2); return 0; }
Output:
Enter first number=60
Enter second number=100
Largest number between 60 and 100 is 100.