Don't ask to ask, just ask | |
PerlMonks |
Re: Manipulating data from a fileby RichardK (Parson) |
on Dec 06, 2012 at 11:52 UTC ( [id://1007545]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|