Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program uses nested if...else statement to find the largest number among three
- #include <stdio.h>
- void main()
- {
- double n1, n2, n3;
- printf("Enter three numbers: ");
- scanf("%lf %lf %lf", &n1, &n2, &n3); //coded by Suman Maji,EIEM,Salboni
- if( n1>=n2 && n1>=n3)
- printf("%.2lf is the largest number.", n1);
- else if (n2>=n1 && n2>=n3)
- printf("%.2lf is the largest number.", n2);
- else
- printf("%.2lf is the largest number.", n3);
- }
Add Comment
Please, Sign In to add comment