This morning, about 40 minutes after I woke up, I was asked to write a method that prints the digits of a number one by one from right to left. So that if you input 1234, the output will be:

4
3
2
1

Now that’s easy. All you have to do is divide the number by 10 four times printing the remainder each time. Your code should look something like this: Continue reading