#include <stdio.h>
int main()
{
int x,y,z;
printf("Enter Three Numbers:--\n");
scanf("%d %d %d",&x,&y,&z);
((x>y)&&(x>z))?printf("Largest is x :-- %d",x):((y>x)&&(y>z))?printf("Largest is y :--%d",y):printf("Largest is z :-- %d",z);
printf("\n");
((x<y)&&(x<z))?printf("Smallest is x :-- %d",x):((y<x)&&(y<z))?printf("Smallest is y :--%d",y):printf("Smallest is z :-- %d",z);
}
Output:
int main()
{
int x,y,z;
printf("Enter Three Numbers:--\n");
scanf("%d %d %d",&x,&y,&z);
((x>y)&&(x>z))?printf("Largest is x :-- %d",x):((y>x)&&(y>z))?printf("Largest is y :--%d",y):printf("Largest is z :-- %d",z);
printf("\n");
((x<y)&&(x<z))?printf("Smallest is x :-- %d",x):((y<x)&&(y<z))?printf("Smallest is y :--%d",y):printf("Smallest is z :-- %d",z);
}
Output:
Enter Three Numbers:--
4
5
7
Largest is z :- 7
Smallest is x :-- 4
No comments:
Post a Comment