Write a program to find largest among 3 numbers using nested if

//this is a program to find largest among 3 numbers using nested if
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;

printf("\n\n Enter any 3 number: ");
scanf("%d%d%d",&a,&b,&c);
   
if(a>b)
{
if(a>c)
{
printf("\n\n Largest is %d",a);
}
else
{
printf("\n\n Largest is %d",c);
}
}
else if(b>c)
{
printf("\n\n Largest is %d",b);

}
else
{
printf("\n\n Largest is %d",c);
}
}


Previous
Next Post »