Calculate the nth Fibonacci number.
Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ...
Examples:
Input n = 5 Output f is 5
Input n = 7 Output f is 13
3 players like this solution
1 player likes this solution
2 players like this solution
1 player likes this solution
7 players like this solution
1 player likes this solution
1 player likes this solution
7 players like this solution
4 players like this solution
4 players like this solution
6 players like this solution
Tags
MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply Today
49 players like this problem
49 players like this problem