/*Program to find the greatest of the given three numbers*/ /*Author : Shekhar*/ /*Date : 28:09:98*/ main() { int a,b,c; clrscr(); printf("Enter the three numbers one by one:\n"); scanf("%d%d%d",&a,&b,&c); if(a!=b) { if(b!=c) { if(a>b) { if(a>c) printf("%d is the greatest.\n",a); } if(b>a) { if(b>c) printf("%d is the greatest.\n",b); } if(c>a) { if(c>b) printf("%d is the greatest.\n",c); } } } if(a==b) { if(b==c) printf("%d, %d and %d are equal.\n"); } if(a==b) { if(b!=c) { if(c>a) printf("%d is the greatest.\n",c); else printf("%d and %d are equal as well as greatest.\n",a,b); } } if(b==c) { if(a!=b) { if(a>b) printf("%d is the greatest.\n",a); else printf("%d and %d are equal as well as greatest.\n",b,c); } } if(a==c) { if(b!=c) { if(b>a) printf("%d is the greatest.\n",b); else printf("%d and %d are equal as well as greatest.\n",a,c); } } }