C Program to find the largest ( biggest or greatest or maximum ) among 3 numbers using Conditional ( ternary ) Operator

We can find the largest (biggest or greatest or maximum) of 3 numbers using Conditional (ternary) Operator. Now, We can write C Program to find the largest (biggest or greatest or maximum) among 3 numbers using Conditional (ternary) Operator. For example: if the given input numbers are 45, -26, 89, then the largest (biggest or greatest or maximum) among 3 numbers is 89. The below given C program will find the largest (biggest or greatest or maximum) of 3 numbers using Conditional (ternary) Operator. Kindly check out the program to find largest (biggest or greatest or maximum).

Program to find largest of 3 numbers using Conditional (ternary) Operator.

#include<stdio.h>

int main()

{

int x, y, z, large;

clrscr();

printf(" Enter any three integer numbers for x, y, z : ") ;

scanf("%d %d %d", &x, &y, &z) ;

large = x > y ? ( x > z ? x : z) : (y > z ? y : z) ;

printf("



Largest or biggest or greatest or maximum among 3 numbers using Conditional ternary Operator : %d", large) ;

getch();

return 0;

}