//Program to find the greatest number among three numbers without using nested if else.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d;
clrscr();
printf("The values of a,b and c");
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{
d=a;
}
else
{
d=b;
}
if(c>d)
{
d=c;
}
else
{
d=d;
}
printf("\n Greatest no. is:%d",d);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d;
clrscr();
printf("The values of a,b and c");
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{
d=a;
}
else
{
d=b;
}
if(c>d)
{
d=c;
}
else
{
d=d;
}
printf("\n Greatest no. is:%d",d);
getch();
}