Loops and file reading on numbers

Hi, Im having a problem with making a program that Finds the sum of every 5th number in the file and report its value.
2. Finds the sum of all even numbers in the fi le and reports its value.
3. Asks the user to input an arbitrary number, say N. Now output a number that indicates how
many odd numbers you need to add up, starting from the beginning of the fi le, until the sum
exceeds the input value of N.
The loop should be preceded by a range test on the input value of the user, making
sure that the input value is greater or equal to 1.
Please help, as this is important for knowledge and understanding
How about you start by reading some tutorial about files? we'd be glad to help after you write some code :)

http://www.cplusplus.com/doc/tutorial/files/
Last edited on
Topic archived. No new replies allowed.