/* EXPERIMENT - 3 */ /* AIM : TO PRINT THE LARGEST OF THREE GIVEN NUMBERS */ /* PROGRAMMER : SHEKHAR SHERIKAR */ main() { float a,b,c; clrscr(); printf("\n\n\t\tThis program will help you to compare three given"); printf(" \n\t\t numbers and print the largest among them."); printf("\n\n\t\t\tEnter the first number : "); scanf("%f",&a); printf("\n\t\t\tEnter the second number : "); scanf("%f",&b); printf("\n\t\t\tEnter the third number : "); scanf("%f",&c); printf("\n\n\n\t\t\t\tA N S W E R"); if((a==b)&&(b==c)) printf("\n\n\t\t The numbers you entered are equal."); else { if((a==b)&&(b!=c)); { if(a>c) printf("\n\n\t\t\t%f and %f are equal aswell as greatest.",a,b); else printf("\n\n\t\t\t%f is the greatest.",c); } if((a!=b)&&(b==c)) { if(a>b) printf("\n\n\t\t\t%f is the greatest",a); else printf("\n\n\t\t\t%f and %f are equal aswell as greatest.",b,c); } if((a==c)&&(a!=b)) { if(a>b) printf("\n\n\t\t\t%f and %f are equal aswell as greatest.",a,c); else printf("\n\n\t\t\t%f is the greatest.",b); } if((a!=b)&&(b!=c)&&(a!=c)) { if((a>b)&&(a>c)) printf("\n\n\t\t\t%f is the greatest.",a); if((b>a)&&(b>c)) printf("\n\n\t\t\t%f is the greatest.",b); if((c>a)&&(c>b)) printf("\n\n\t\t\t%f is the greatest.",c); } } getch(); }