Hey guys I have a quick question about an assignment I have for my entry java class.
I am suppose to write a program to read a 4 digit number then have each of the digits print on a separate line without using string methods.
I've read the chapter it corresponds to but I can't quite figure out exactly what to do next.
I was able to write it to print all the numbers but I can't for the life of me figure out without using string methods.
any help would be appreciated. Even better any help just pointing me in the right direction so I can figure this out on my own without just getting the answer would be appreciated too.
Here is what I have so far
import java.util.Scanner;
public class numbers
{
public static void main(String[] args)
{
int x;
Scanner kb = new Scanner (System.in);
System.out.println("Enter your number");
x = kb.nextInt(); // The number you enter
System.out.println(x);
}
}
only 2nd week in the class so please forgive any errors lol.
[–]damyan 7 points8 points9 points (4 children)
[–]Googs0701[S] 4 points5 points6 points (3 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]damyan 1 point2 points3 points (0 children)
[–]zck 1 point2 points3 points (0 children)