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

Function fibonacci

examples/basic_singlethreaded.cpp:23–27  ·  view source on GitHub ↗

Function to calculate the nth Fibonacci number

Source from the content-addressed store, hash-verified

21
22// Function to calculate the nth Fibonacci number
23int fibonacci(int n) {
24 CTRACK; // Start tracking this function
25 if (n <= 1) return n;
26 return fibonacci(n - 1) + fibonacci(n - 2);
27}
28
29int main() {
30

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected