J
Jay Nabonne
Thanks for the obvious.
Anyways this is what I got so far, however for some reason only the
last digit displays.
while (dig > 0) {
dig = dig%10; // (1)
total += dig%10; // (2)
dig = dig/10; // (3)
}
Just about. Just don't do the initial mod in the loop (1). You want to add
the mod to the total (2), and then divide by 10 to get the next digit into
low position (3).
- Jay