Greater number between three numbers


#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,c;
clrscr();
printf("enter three numbers a,b,c");
scanf("%d%d%d",&a,&b,&c);
if(a>b && a>c)
printf("\n a is greater then b and c");
else if(a==b && a>c)
printf("\n a and b both are equal and greater then c");
else if(b>a && b>c)
printf("\n b is greater then a and c");
else if(b==c && b>c)
printf("\n b and c both are equal and greater then c");
else if(c>a && c>b)
printf("\n c is greater then a and b");
else if(c==a && c>b)
printf("\n c and a both are equal and greater then b");
else if(a==b && a==c && b==c)
printf("\n enter three non-equal no.s");
getch();
return 0;
}

0 comments:

Post a Comment