Professional Documents
Culture Documents
Problem: Take three numbers from user and print the greater number e.g.
No1 is 12, No2 is 26, No3 is 92. Output: No3 is greater which is 92.
#include <conio.h>
#include <stdio.h>
void main()
{
clrscr();
int no1,no2,no3;
if(no1==no2&&no1==no3)
printf("\n All Numbers are Equal");
else if(no1>no2&&no1>no3)
printf("\n 1st Number is greater which is: %d",no1);
else if(no2>no1&&no2>no3)
printf("\n 2nd Number is greater which is: %d",no2);
else if(no3>no1&&no3>no2)
printf("\n 3rd Number is greater which is: %d",no3);
else if(no1==no2&&no1>no3)
printf("\n 1st and 2nd numbers are Equal but Greator than
3rd");
else if(no1==no3&&no1>no2)
printf("\n 1st and 3rd numbers are Equal but Greator than
2nd");
else if(no2==no3&&no2>no1)
printf("\n 2nd and 3rd numbers are Equal but Greator than
1st");
getch();
}
URL: http://ravianeducation.blogspot.com
E-Mail: mail2ravian@gmail.com
Farhan: 03008855006