I think it's easier to use maths to calculate the sum of the digits of an integer.
As this is your homework I'm not going to post the code but it's pretty simple using a while loop, the modulo operator % and int.
In reply to Re: Manipulating data from a file
by RichardK
in thread Manipulating data from a file
by CrimSin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |