Read integer numbers from a file and return the arithmetic mean

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • minduser
    New Member
    • Sep 2009
    • 4

    #1

    Read integer numbers from a file and return the arithmetic mean

    How can I do that?

    What do I have to do after:
    (...)
    while(fscanf(fp ,"%d",&c) != EOF) {

    ?
    Thanks.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Read the file.

    Put the numbers you read into an array.

    After the file is read, process your array to calculate the mean value.

    Comment

    Working...