#include<stdio.h> #include<conio.h> main() { int n1,n2,n3,l; printf("Enter the three numbers :\n"); scanf("%d %d %d",&n1,&n2,&n3); l=(n1>n2&&n1>n2?n1:n2>n3?n2:n3); printf("Largest of three = %d",l); getch(); } Output Screenshot for largest of three numbers Related programs: Smallest of three numbers using conditional operator. largest of n number without using conditional operator. Conditional operator in c.
No comments