Zebra0.com

cpp recursionFibonacci Sequence

Fibonacci Sequence

Fibonacci: for n=0 or 1, fibonacci[n]=1.
Otherwise fibonacci[n]=fibonacci[n-1]+fibonacci[n-2].
In other words, each number is the sum of the preceding two values in the sequence.