I have a homework question. I am not sure how to write the program for.
Write a looping code segment that takes as input up to 20 integer scores from file indata, and outputs their average. If the file contains fewer than 20 scores, the segment should still output the correct average. If the file contains more than 20 scores, the additional numbers should be ignored.
@hbjgd
After having said that you won't do his/her homework, you still gave away the code!?
And as for Chan,
Are you asking how to put 20 integers in file? Open up notepad and simply type 20 numbers separated by a space. Now that isn't much hard is it?