Program to find greater number using ternary operators in C
#include <stdio.h>
#include <conio.h>
main() {
int x,y,z; clrscr();
printf("First Number : "); scanf("%d", &x);
printf("Second Number : "); scanf("%d", &y);
z=(x>y ? x : y);
printf("\nGreater number : %d", z);
getch();
}
Post a Comment