Write a C program to return the largest out of 3 floating values.
Expert Answer
code.c
#include<stdio.h>
int main(){
float a,b,c;
printf(“nEnter value for a : “);
scanf(“%f”,&a);
printf(“Enter value for b : “);
scanf(“%f”,&b);
printf(“Enter value for c : “);
scanf(“%f”,&c);
if (a>b)
{
if(a>c)
{
printf(“%.3f is the biggest”,a);
}
else
printf(“%.3f is the biggest”,c);
}
else
{
if(b>c)
{
printf(“%.3f is the biggest”,b);
}
else
printf(“%.3f is the biggest”,c);
}
return 0;
}
OUTPUT: