Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.

Commit 3b167c8

Browse files
C Files
1 parent ca8538b commit 3b167c8

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

Nested_If-else/greatest_number.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//
2+
3+
#include <stdio.h>
4+
5+
int main()
6+
{
7+
/*Largest of Three Numbers in C Using Nested if Else */
8+
double num1, num2, num3;
9+
10+
printf("Enter Three Numbers: ");
11+
scanf("%lf %lf %lf", &num1, &num2, &num3);
12+
13+
if (num1 >= num2)
14+
{
15+
if (num1 >= num3)
16+
printf("%.2lf Is The Largest Number. ", num1);
17+
else
18+
printf("%.2lf Is The Largest Number. ", num3);
19+
}
20+
else
21+
{
22+
if (num2 >= num3)
23+
printf("%.2lf Is The Largest Number. ", num2);
24+
else
25+
printf("%.2lf is the largest number.", num3);
26+
}
27+
28+
return 0;
29+
}

Nested_If-else/greatest_number.exe

383 KB
Binary file not shown.

0 commit comments

Comments
 (0)