Question: 1- Write a program to read 10 numbers and find the average of these numbers. Use a while loop to read these numbers and keep
1- Write a program to read 10 numbers and find the average of these numbers. Use a while loop to read these numbers and keep track of input numbers read. Terminate the while loop with a sentinel value.
2- Now modify the program to find the maximum of these numbers as well. The program should print the number of elements read as input and run until -1 is entered. (-1 is the sentinel that terminates the loop and the program) To find the maximum, you want to read the first number outside the loop and assign it to the max variable. As you read each number you must use the if statement and check it against max.
In C language please.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
