//C Program to find out Maximum of 3 number’s using Conditional Operator
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter 3 nos:\n \n");
scanf("%d%d%d",&a,&b,&c);
(a>b)?((a>c)?printf("a is max"):printf("c is max")):((b>c)?printf("b is max"):printf("c is max"));
getch();
}
Hope you liked my posts, give comments if you have any doubts.. :)#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter 3 nos:\n \n");
scanf("%d%d%d",&a,&b,&c);
(a>b)?((a>c)?printf("a is max"):printf("c is max")):((b>c)?printf("b is max"):printf("c is max"));
getch();
}
Categories:
c program
0 comments:
Post a Comment