Skip to content

Commit 77eeb67

Browse files
Create factorial.java
1 parent 1ff1c3c commit 77eeb67

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Miscellaneous/factorial.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import java.math.BigInteger;
2+
3+
public class factorial{
4+
public static BigInteger rec(int q){
5+
BigInteger u=BigInteger.valueOf(q);
6+
if(q==1)
7+
{
8+
return u;
9+
}
10+
else
11+
return (u.multiply(rec(q-1)));
12+
}
13+
public static void main(String[] args){
14+
int a=100;
15+
System.out.println(rec(a));
16+
}
17+
}

0 commit comments

Comments
 (0)