can anyone solve?
write a program in C language to calculate the arithmetic mean of a series of numbers entered from the keyboard.
- EddieJLv 71 week agoFavorite Answer
Initialize total to zero
Initialize counter to zero
Start a loop:
... Use scanf () to read a number
... Add the number to the total
... Increment the counter
mean = number / counter
Keep in mind that you need to use a <float> or <double> or you will get integer division that will truncated the decimal places.
- Jogger2425Lv 61 week ago
Yes. Many people can solve that.
It's a middle-school level problem.
The word "average" , in general, it refers to some middle value. The most common is the "arithmetic mean". To calculate an arithmetic mean of a set of numbers do this:
* Add up the numbers. Call the sum S.
* Keep track of how many numbers there are. Call that N.
* Divide S by N: A = S / N.
* The result (A) is the arithmetic mean.