Skip to content

Commit 39e8aef

Browse files
Merge pull request seeditsolution#52 from shiv-garg/patch-1
Create GREATER NO.
2 parents 55d881b + d54cf54 commit 39e8aef

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

GREATER NO.

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
int main() {
2+
double n1, n2, n3;
3+
printf("Enter three different numbers: ");
4+
scanf("%lf %lf %lf", &n1, &n2, &n3);
5+
6+
// if n1 is greater than both n2 and n3, n1 is the largest
7+
if (n1 >= n2 && n1 >= n3)
8+
printf("%.2f is the largest number.", n1);
9+
10+
// if n2 is greater than both n1 and n3, n2 is the largest
11+
if (n2 >= n1 && n2 >= n3)
12+
printf("%.2f is the largest number.", n2);
13+
14+
// if n3 is greater than both n1 and n2, n3 is the largest
15+
if (n3 >= n1 && n3 >= n2)
16+
printf("%.2f is the largest number.", n3);
17+
18+
return 0;
19+
}

0 commit comments

Comments
 (0)