Write a program to check the greatest number among three numbers using nested if-else statement.
#inlcude<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf(“Enter the three numbers:”);
scanf(“%d%d%d”,&a,&b,&c);
if(a>b)
{
if(a>c)
{
printf(“Largest number is %d”,a);
}
else
{
printf(“Largest number is %d”,c);
}
}
else
{
if(b>c)
{
printf(“Largest number is %d”,b);
}
else
{
printf(“Largest number is %d”,c);
}
}
getch();
}
0 Comments
Have any query? Want any type of module?
Please comment it down and let me know.