Hello All:

I searched through the old posts, but could not find an answer as how to read numbers from a sequential text file & calculate the average of the numbers. Do you place the calculation to find the averages outside of the loop to read the text file? If so, how do you transfer the number total outside of the loop? If it is inside the loop, how do you add all the numbers (in this case 25 numbers) together before averaging?

Hope my question makes sense! Thanks!

Hello All:

Hello you...

I searched through the old posts, but could not find an answer as how to read numbers from a sequential text file & calculate the average of the numbers.

Then you would have seen you need to post code pointing out your immediate problem. And use CODE Tags.

Do you place the calculation to find the averages outside of the loop to read the text file? If so, how do you transfer the number total outside of the loop?

How many times do you normally calculate the actual average of 25 numbers? That's the calculation itself.

If it is inside the loop, how do you add all the numbers (in this case 25 numbers) together before averaging?

The last part of this question seems to answer the previous question, does it not?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.