MCPcopy Create free account
hub / github.com/Compaile/ctrack / factorial

Function factorial

examples/basic_singlethreaded.cpp:16–20  ·  view source on GitHub ↗

Function to calculate the factorial of n

Source from the content-addressed store, hash-verified

14
15// Function to calculate the factorial of n
16unsigned long long factorial(int n) {
17 CTRACK; // Start tracking this function
18 if (n <= 1) return 1;
19 return n * factorial(n - 1);
20}
21
22// Function to calculate the nth Fibonacci number
23int fibonacci(int n) {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected