Skip to content

Commit 1fbed48

Browse files
committed
Add recursive number printing implementation
1 parent 9deb794 commit 1fbed48

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Recursion/n_Number.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
public class n_Number {
2+
3+
public static void main(String[] args) {
4+
fun1(5);
5+
}
6+
7+
static void fun1(int n) {
8+
{
9+
if (n == 0) {
10+
return;
11+
}
12+
fun1(n-1);
13+
System.out.println(n);
14+
}
15+
16+
}
17+
}

0 commit comments

Comments
 (0)