Question: Write a program using java that reads in an integer and breaks it into a sequence of individual digits. For example, the input 16384 is
Write a program using java that reads in an integer and breaks it into a sequence of individual digits. For example, the input 16384 is displayed as
1 6 3 8 4
Assume that the input has no more than five digits and is not negative
Test your program with 0, single digits, 2-digit, ... 5-digit numbers.
- treat input as integer, not a string... use nextInt() method to read the whole integer, not next() or nextLine().
- Use the division and mod operators to find the each digit of the integer.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
