C Program To Find Greater Number. Among Given Three Number
belongs to collection: Basic C Programs for Practice
All Answers
need an explanation for this answer? contact us directly to get an explanation for this answer
#include <stdio.h>
int main()
{
double num1, num2, num3;
printf("Enter Three Numbers: ");
scanf("%lf %lf %lf", &num1, &num2, &num3);
if (num1>=num2)
{
if(num1>=num3)
printf("%.2lf Is The Largest Number. ", num1);
else
printf("%.2lf Is The Largest Number. ", num3);
}
else
{
if(num2>=num3)
printf("%.2lf Is The Largest Number. ", num2);
else
printf("%.2lf is the largest number.",num3);
}
return 0;
}
Output:
Enter Three Numbers: 123.456
456.789
789.12
789.12 is the largest number.
need an explanation for this answer? contact us directly to get an explanation for this answertotal answers (2)
Output:
Enter Three Numbers:
555
555
555
All Are Equal
need an explanation for this answer? contact us directly to get an explanation for this answer