Skip to content

Commit eeccfbe

Browse files
author
Sonny Li
committed
Week 3
1 parent dca7b5f commit eeccfbe

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Programs/hypotenuse.c

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Louie Kotler
2+
// Fun Fact: I play the didgeridoo. It's an Australian aboriginal instrument.
3+
4+
#include <stdio.h>
5+
#include <math.h>
6+
7+
void findh() {
8+
9+
int a, b;
10+
float c;
11+
12+
printf("Enter side a: ");
13+
scanf("%d", &a);
14+
15+
printf("Enter side b: ");
16+
scanf("%d", &b);
17+
18+
c = sqrt(a*a + b*b);
19+
20+
printf("The hypotenuse is %f\n\n", c);
21+
22+
}
23+
24+
int main() {
25+
26+
findh();
27+
findh();
28+
findh();
29+
30+
return 0;
31+
32+
}

0 commit comments

Comments
 (0)