Java program to print the number positions in list of digits

Java program to print the number positions in list of digits. This is a Java program for extracting digits from an integer value. As an input, you can use any integer. After that, we perform operations such as modulus and division to determine the number of digits in a given integer, and then we print each of the digits. The Java Program to Extract Digits from a Given Integer source code is available here.

import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
int n, m, a, i = 1, checker = 0;
Scanner s=new Scanner(System.in);
System.out.print("Enter any numbers");
n = s.nextInt();
m = n;
while(n > 0)
{
n = n / 10;
checker++;
}
while(m > 0)
{
a = m % 10;
System.out.println("numbers position is "+checker+":"+a);
m = m / 10;
checker--;
}
}
}

Enter any numbers  4567
numbers position is 4:7
numbers position is 3:6
numbers position is 2:5
numbers position is 1:4