Input a list of positive numbers ( terminated by 0) into an array, find the mean ( average) of the numbers in the array, and output the result. Use a subprogram to input the numbers, a function to find the mean, and a sub-program to output the result.

1 answer

to find the average, just add up all the numbers and divide by how many there are.

That means you have to count them as you read them.