C/C++ Program for n-th Fibonacci number
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation
Fn = Fn-1 + Fn-2
with seed values
F0 = 0 and F1 = 1.
Method 1 ( Use recursion )
Method 2 (Dynamic Programming)
Method 3 (Dynamic Programming with Space Optimization)