someone please help!!!

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.
Sure! I'd love to be of some assistance!

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

http://www.cplusplus.com/doc/tutorial/control/
> This links to a section of the tutorial on this website that covers control structures.

After you've read up on these things, attempt to do your assignment and post the code here if you have any issues.

Also, you might want to note that this forum is for off topic discussion, you'd probably want to move this thread over to the beginner's section.
Topic archived. No new replies allowed.