#include<stdio.h>
void 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);
((x<y)&&(x<z))?printf("Smallest is x :-- %d\n",x):((y<x)&&(y<z))?printf("Smallest is y :--%d\n",y):printf("Smallest is z :-- %d\n",z);
}
void 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);
((x<y)&&(x<z))?printf("Smallest is x :-- %d\n",x):((y<x)&&(y<z))?printf("Smallest is y :--%d\n",y):printf("Smallest is z :-- %d\n",z);
}
Enter Three Numbers:--
12
5
40
Largest is z :-- 40 Smallest is y :--5
No comments:
Post a Comment