Anonymous
Anonymous asked in Computers & InternetProgramming & Design · 1 week ago

can anyone solve?

write a program in C language to calculate the arithmetic mean of a series of numbers entered from the keyboard.

Pleaseeee helpppp

2 Answers

Relevance
  • EddieJ
    Lv 7
    1 week ago
    Favorite 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

    End loop

    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.

  • 1 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.

Still have questions? Get your answers by asking now.