repl.it
Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.util.Scanner;

class Main {
   public static void printDecimal(int n) {
 			if ( n>= 10)
 				printDecimal(n/10);
 			System.out.println(n%10);
 }
	
	
	public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
		System.out.println("Enter an integer: ");
		int n = scan.nextInt();
		printDecimal(n);

  }
}
Fetching token
?