Fibonaccin function n is an integer The function returns the
Solution
Answer:
Program:
#include<iostream>
 
 using namespace std;
 
 int fibonaccirecursive(int input)
 {
 if((input==1)||(input==0))
 {
 return(input);
 }
 else
 {
 return(fibonaccirecursive(input-1)+fibonaccirecursive(input-2));
  }
 }
 
 int main()
 {
 int input,i=0;
   
 cout<<\"\ Nth Fibonacci number\ \";
 
 while(i<=20)
 {
 cout<<\"The \"<< i <<\"th Fibonacci number is: \"<<fibonaccirecursive(i)<<endl;
 i++;
 }
 
 return 0;
 }
Output:
Nth Fibonacci number The 0th Fibonacci number is: 0
The 1th Fibonacci number is: 1
The 2th Fibonacci number is: 1
The 3th Fibonacci number is: 2
The 4th Fibonacci number is: 3
The 5th Fibonacci number is: 5
The 6th Fibonacci number is: 8
The 7th Fibonacci number is: 13
The 8th Fibonacci number is: 21
The 9th Fibonacci number is: 34
The 10th Fibonacci number is: 55
The 11th Fibonacci number is: 89
The 12th Fibonacci number is: 144
The 13th Fibonacci number is: 233
The 14th Fibonacci number is: 377
The 15th Fibonacci number is: 610
The 16th Fibonacci number is: 987
The 17th Fibonacci number is: 1597
The 18th Fibonacci number is: 2584
The 19th Fibonacci number is: 4181
The 20th Fibonacci number is: 6765


