You are on page 1of 1

Intermediate Part II

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;

printf("Enter the 1st no: ");


scanf("%d",&no1);
printf("Enter the 2nd no: ");
scanf("%d",&no2);
printf("Enter the 3rd no: ");
scanf("%d",&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();
}

Click the link below to see more examples

URL: http://ravianeducation.blogspot.com
E-Mail: mail2ravian@gmail.com
Farhan: 03008855006

You might also like