Search This Blog

Friday, April 22, 2011

CODE 02

//GAURAV MITTAL(2K9/EE/830)
//QUESTION 2. Find greatest of three numbers

#include
#include

int main ()
{
float a,b,c;
printf("GREATEST OF THREE NUMBERS");
printf("Enter first number : ");
scanf("%f",&a);
printf("\nEnter second number : ");
scanf("%f",&b);
printf("\nEnter third number : ");
scanf("%f",&c);

if((a>b)&&(a>c))

printf("\nThe greatest of three numbers is : %f",a);

else if((b>a)&&(b>c))

printf("\nThe greatest of three numbers is : %f",b);
else

printf("\nThe greatest of three numbers is : %f",c);


getch();
return 0;
}

No comments:

Post a Comment