I am making this program that will take a positive integer and turn it into this
Ex: Enter a positive integer: 245
2
4
5
I am wondering if I am doing this right. I know there might be some parse errors. but all I am concerned with, if is the overall structure and concept of my program is correct, apreciate any help.
import java.util.Scanner
public class DigitsDisplay
{
public static void main(String[] args)
{
int digit;
Scanner input = new Scanner (System.in);
System.out.print("Enter a positive integer: ");
digit = input.nextInt();
count = 0;
while (digit != 0)
{
count + = 1;
digit % 10;
System.out.println(digit);
}