MCPcopy Create free account
hub / github.com/apna-college/Alpha / fact

Method fact

7_RecursionBasics/RecursionBasics.java:20–27  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

18 }
19
20 public static int fact(int n) {
21 if(n == 0) {
22 return 1;
23 }
24 int fnm1 = fact(n-1);
25 int fn = n * fact(n-1);
26 return fn;
27 }
28
29 public static int calcSum(int n) {
30 if(n == 1) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected