imesecan | Feb.13.2011 at 10:55:31 AM | |
0 | The question doesn't mention the number of digits. So, the number can have 4 or five digits or 10 digits.
As far as the number has digits we take the digits one by one; and then calculate the sum.
|
imesecan | Feb.17.2011 at 09:06:42 AM | |
1 | You can use a while loop copiednum=num; while (copiednum>0)
and always get the last digit using %10 then divide the number by 10. When number has 1 digit and you divide it by 10, the number will be then 0 and it will quit from the loop.
|
imesecan | Feb.20.2011 at 01:24:51 PM | |
2 | Post is deleted
|
imesecan | Feb.20.2011 at 01:53:15 PM | |
3 | Your program using a loop somewhere and it's going probably infinite :)
Or it's expected to solve in one second but your solution is taking more...
|