Program to display Largest/Maximum number in 3 integers using conditional operator

//Program to display Largest/Maximum number in 3 integers using conditional operator
#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,c,d;
clrscr();
printf("Enter Three Integer Numbers\n");
scanf("%d%d%d",&a,&b,&c);
d=a>b?(a>c?a:c):b>c?b:c;
printf("%d is Maximum",d);

getch();
return 0;
}


To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.

No comments:

Post a Comment