Question: Write C code 2. Write a program to calculate the arithmetic mean, the geometric mean, and the harmonic mean for a set of non- zero
Write C code 2. Write a program to calculate the arithmetic mean, the geometric mean, and the harmonic mean for a set of non- zero numbers. Ask the user to enter values for the numbers between 0 and 10 and enter -99 when they are done. Within the sentinel loop, calculate the required sums and product. Use doubles for the variables. Implement this loop as while loop mean geometric mean-x,xx harmonic mean1 x, X Calculate the means after exiting from the loop and print each result to the screen using 3 decimal digits. Test with 8.2, 6.3, 5.2, 4.5, 7.8 3. Write a program that uses a while loop which will generate 5 random numbers of datatype int that are between 0 and 100. Determine the following about the 5 random numbers . The mean of the 5 numbers The maximum value generated The minimum value generated e number of even numbers . Th The number of odd numbers The program should output the five numbers, the mean, the max, the min, the number of even numbers, and the number of odd numbers to the screen
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
