10. Write a program to read three numbers from the keyboard and find out the maximum out of these three. (nested if-else)
#include<stdio.h> ( this applies in the given code )
#include
int main()
{
int a,b,c;
printf(“\n Enter First Number :”);
scanf(“%d”,&a);
printf(“\n Enter Second Number :”);
scanf(“%d”,&b);
printf(“\n Enter Third Number :”);
scanf(“%d”,&c);
if(a>b)
{
if(a>c)
{
printf(“\n First Number %d is maximum”,a);
}
else
{
printf(“\n Third Number %d is maximum”,c);
}
}
else
{
if(b>c)
{
printf(“\n Second Number %d is maximum”,b);
}
else
{
printf(“\n Third Number %d is maximum”,c);
}
}
return 0;
}