A C Program to find maximum among three numbers using conditional operator.


#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,x,y;


clrscr();
printf("Enter value of a:");
scanf("%d",&a);
printf("Enter value of b:");
scanf("%d",&b);
printf("Enter value of c:");
scanf("%d",&c);
x=(a>b)?a:b;
y=(x>c)?x:c;
printf("Maximum among all is :%d",y);
getch();
}

Comments