Java program that read a five-digit positive integer and breaks it into a sequence of individual digits
###### Posted by Samath
Last Updated: February 10, 2021

Write a Java program that reads a five-digit positive integer and breaks it into a sequence of individual digits. For example, the input 16384 is displayed as
1 6 3 8 4

Code:

```import java.util.Scanner;

public class Main
{
public static void main(String[] args) {

int number;
int num1;
int num2;
int num3;
int num4;
int num5;

Scanner input = new Scanner(System.in);
System.out.print("Enter a Five-digit number: ");
number = input.nextInt();

input.close();

num1 = number % 10;
number /= 10;

num2 = number % 10;
number /= 10;

num3 = number % 10;
number /= 10;

num4 = number % 10;
num5 = number /  10;

System.out.printf("%d %d %d %d %d", num5, num4, num3, num2, num1);
}
}
```
###### C program that prompts the user for a positive integer and then computes the sum of all the digits of the number
Samath | May 04, 2016
###### Java program that reads an integer and prints how many digits the number has
Samath | Feb 11, 2021
###### C++ Summing the digits in an integer
Samath | Jan 06, 2021
###### Recursive function that find the sum of digits in a integer using C++
Samath | Dec 24, 2014
###### Summing the Digits in an Integer using Python
Samath | Mar 02, 2015
###### Java program that reads an integer and prints if it's positive or negative
Samath | Feb 11, 2021
###### Java program that read a sequence of integer inputs and print the smallest and largest of the inputs
Samath | Apr 03, 2022
###### Java program that read a sequence of integer inputs and print the number of even and odd inputs.
Samath | Apr 03, 2022
###### C program that takes a 2 digit hexadecimal number and display it in binary format
Samath | Jan 01, 2017
###### How do you use the DATEFROMPARTS function to create a date from individual year, month, and day values?
RoseHrs | Jun 18, 2024
###### SQL Display two digits after decimal point
SceDev | Feb 08, 2024
###### Java program that turns a string containing a 10 digit phone number into a more readable string with parentheses and dashes
Samath | Feb 11, 2021
###### How do you use the TIMEFROMPARTS function to create a time value from individual hour, minute, and second values?
RoseHrs | Jun 02, 2024
###### Python program that test if integer values can form a triangle
Samath | Nov 06, 2014