Exercise: Number To Digits

Write a console program that prints the individual digits of a number.

You can print the digits from right to left.

For example (user input in green):

Enter a number:
1234
4
3
2
1
Another example:
Enter a number:
0
0

Hand in instructions

  1. Make sure your program runs correctly.
  2. Hand in your program by uploading Main.java to Moodle.