Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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)

AltStyle によって変換されたページ (->オリジナル) /