I want to write a program that reads a series of numbers and calculates the average, geometric mean, and harmonic mean. I know the jist of what to do, but I don't know how to write the program.

Here is what I have come up with for the program:

The average is: sum/n

The harmonic mean is: n/inverse sum (ex: 4/((1/5)+(1/3)+(1/2)+(1/4)))

The geometric mean is: (X1 * X2 * X3 * Xn)^(1/n) - to write this in C I know it is pow (product, 1.0/n);

If given a set of numbers such as:

Number 1 = 5... then the sum is 5, product is 5, and inverse sum is 1/5

Number 2 = 3... then the sum is 8, product 15, inv sum 1/5 + 1/3

and so on...

I have an idea of what to do but I'm not sure how to do it properly. I think it is something like below:

If anyone could help me with the parts I am missing I would appreciate it.Code:int num = 1; while (num!=0) { printf("Enter a number(0 to quit): ") scanf("%d", &num); if (num!= 0) { Enter numers } } (enter zero) do the execution of the equations