Skip to content

Commit 333c31c

Browse files
Factorial of a number
1 parent 20cc4ad commit 333c31c

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed
673 Bytes
Binary file not shown.
163 Bytes
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package factorialOfANumber;
2+
3+
public class Factorial {
4+
5+
public static int fact(int a) {
6+
if (a <= 1) {
7+
return 1;
8+
}else {
9+
return(a * fact(a-1));
10+
}
11+
}
12+
public static void main(String[] args) {
13+
System.out.println(fact(5));
14+
15+
}
16+
17+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
*
3+
*/
4+
/**
5+
*
6+
*/
7+
module RecursionFactorialOfANum {
8+
}

0 commit comments

Comments
 (0)