Question: Using visual studio 2015 and printf and scanf Write a program to calculate the arithmetic mean, the geometric mean, and the harmonic mean for a

Using visual studio 2015 and printf and scanf  Using visual studio 2015 and printf and scanf Write a program

Write a program to calculate the arithmetic mean, the geometric mean, and the harmonic mean for a set of numbers. Enter the values until the end of the file is found or a sentinel is encountered. Calculate the required sums and product in a single while loop. (Refer to the example under while Loops. c posted on Canvas. To execute when the end of file method is used, continue entering values, one per line, until there are no more to enter; then type CTRL^Z and then hit ENTER once more if necessary.) You may not enter how many values there are. You will have to keep track of the number of values entered with a counter. Use floats or doubles for the values. arithmetic_mean = x_1 + x_2 + x_3 +...+ x_m geometric_mean \= n Squareroot x_1 * x_2 *...* x_n harmonic_mean = n/1/x_1 + 1/x_2 + + 1/x_n Calculate the means after exiting from the loop and print using 3 decimal digits. Use the following 5 numbers as the set of test values: {4.2, 6, 8.7, 2, 3}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!