Skip to content

Commit ab4c4b5

Browse files
committed
C_Tut_14
Moar math
1 parent b98cfdc commit ab4c4b5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

C/14_cProgramming.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
// Moar math.
3+
4+
#include <stdio.h>
5+
#include <stdlib.h>
6+
7+
8+
int main()
9+
{
10+
11+
float age1, age2, age3, average;
12+
age1 = age2 = 4.0;
13+
14+
printf("Enter your age\n");
15+
scanf("%f", &age3);
16+
17+
average = (age1 + age2 + age3) / 3;
18+
printf("\n The average age of the group is %f", average);
19+
20+
return 0;
21+
}

0 commit comments

Comments
 (0)