MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / fib

Function fib

Exercises/Modules/Chapter 08/Soln8_07.cpp:20–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20unsigned long long fib(size_t n)
21{
22 switch (n)
23 {
24 case 0: return 0;
25 case 1: return 1;
26 default: return fib(n-2) + fib(n-1);
27 }
28}

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected