Question: The Fibonacci sequence 1 , 1 , 2 , 3 , 5 , 8 , 1 3 , 2 1 . . . . .
The Fibonacci sequence starts with two s and each term afterwards is the sum of its two predecessors. Please write a function, Fibn which takes n as the input parameter. It will return the nth number in the Fibonacci sequence.
Testing commands: Fib; Fib; Fib
Use loop
Use recursion
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
