MCPcopy Create free account
hub / github.com/Manvityagi/PW-Skills-Java-Course-Codes / printIncreasing

Method printIncreasing

Lecture 27/src/Main.java:19–31  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

17 }
18
19 static void printIncreasing(int n){ // 1, 2, ..... n-1, n
20 //base case
21 if(n == 1){
22 System.out.println(n);
23 return;
24 }
25
26 //recursive work
27 printIncreasing(n-1); // 1, 2, .... n-1
28
29 //self work
30 System.out.println(n);
31 }
32
33 public static void main(String[] args) {
34 Scanner sc = new Scanner(System.in);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected