/* WAP to find the largest of three numbers using nested if. */
#include<stdio.h>
main()
{
int a,b,c,big;
clrscr();
printf(“Enter three numbers”);
scanf(“%d%d%d”,&a,&b,&c);
if(a>b)
if(a>c)
big=a;
else
big=c;
else
if(b>c)
big=b;
else
big=c;
printf(“Largest of %d,%d and %d=%d”,a,b,c,big);
getch();
}
OUTPUT
Enter three numbers 10 5 16
Largest of 10,5 and 16=16
Latest posts by Mohit Arora (see all)
- MongoDB Operators Tutorial – What are Different Operators Available? - October 5, 2019
- MongoDB Projection Tutorial : Return Specific Fields From Query - March 9, 2019
- MongoDB Index Tutorial – Create Index & MongoDB Index Types - July 6, 2018