Im fairly new to C++ and am currently in class. The homework problem i've been given says to download an instructor provided txt doc with 100 numbers. I have to write a program that will count the numbers, sum them and average them. Below is my code. I thought this would work but the numbers are all screwy. Can someone explain what I did wrong? thanks
That for loop is going to add num into your sum num times, when you only should be doing it once for each number. You shouldn't really be looping on count at all; just use that to record the total amount of numbers you get and use it to calculate the average.