Skip to content

Commit d54cf54

Browse files
authored
Create GREATER NO.
Greater of the no.
1 parent c5c05c2 commit d54cf54

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

GREATER NO.

+19
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)