MCPcopy Create free account
hub / github.com/anupam-kumar-krishnan/Competitive_Programming / factorial

Function factorial

Basic Programming/All_Patterns.c:54–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54int factorial(int n) {
55 if (n == 0 || n == 1) {
56 return 1;
57 } else {
58 return n * factorial(n - 1);
59 }
60}
61
62int binomialCoefficient(int n, int r) {
63 return factorial(n) / (factorial(r) * factorial(n - r));

Callers 1

binomialCoefficientFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected