Question: Your task is to break a number into its individual digits, for example, to turn 1729 into 1, 7, 2, and 9. It is easy
Your task is to break a number into its individual digits, for example, to turn 1729 into 1, 7, 2, and 9. It is easy to get the last digit of a number n as n % 10. But that gets the numbers in reverse order. Solve this problem with a stack. Your program should ask the user for an integer, then print its digits separated by spaces.
Step by Step Solution
3.50 Rating (170 Votes )
There are 3 Steps involved in it
ANSWER public class Digits public static void mainString args Scanne... View full answer
Get step-by-step solutions from verified subject matter experts
