Finding average of integers from a text file?

I have a integers.txt file and I want to read it in and then find the average of all the numbers. I know I need a loop counter? But how does my calculation look and where would it be? Outside the while loop? How would I (add up all the numbers) / (loopcounter) = output?
Make a loop in which you sum the values and keep track of the number of values, then do the final calculation when the loop ended
How many variables do I need? all I can think of is int loopcounter
What else would you need to keep track of if you want an average?
Topic archived. No new replies allowed.