05 Jun Markham Saturday 14:00 Java Homework 20.05.30.
Question:
Use recursion to print the Nth number in the fibonacci sequence.
Note : The Fibonacci Sequence is the series of numbers, the first two numbers are 0 and 1 :
0, 1, 1, 2, 3, 5, 8, 13, 21, ….
Every next number is found by adding up the two numbers before it.
Sample Input 1: 1 Sample Output 1: 0
Sample Input 2: 2 Sample Output 2: 1
Sample Input 3: 5 Sample Output 3: 3
Sample Input 4: 7 Sample Output 4: 8
Sorry, the comment form is closed at this time.