We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af59bca commit 5a23b8dCopy full SHA for 5a23b8d
code/tutorial_51.java
@@ -0,0 +1,34 @@
1
+class Driver {
2
+
3
+ public static void main(String[] args) {
4
5
+ System.out.println( factorial(4) );
6
+ looper(0);
7
+ looper(5,20,2);
8
9
+ }
10
11
+ static void looper(int i) {
12
+ System.out.println(i);
13
+ i++;
14
+ if (i < 10) {
15
+ looper(i);
16
17
18
19
+ static void looper(int start, int end, int step) {
20
+ System.out.println(start);
21
+ start += step;
22
+ if (start < end) {
23
+ looper(start, end, step);
24
25
26
27
+ static int factorial(int n) {
28
+ if (n == 0) {
29
+ return 1;
30
31
+ return n * factorial(n - 1);
32
33
34
+}
0 commit comments