i have a file with numbers 2301
3302
1234567890
147483648
789
5
and i must use an event-controlled (EOF)-while loop to read an unknown number of positive integers. For each number, output the original number and then use another nested event-controlled while loop to calculate and print the sum of the digits of the number, as shown below. At the end, print the number of integers that were read, and the total sum of digits.
if i could know how to do one i know i can do the others..can someone help me.
http://www.cplusplus.com/reference/iostream/ifstream/
> This is a link to a page containing all the methods and members defined in the ifstream class. I would suggest taking a look at the member called eof, and the method called getline