# Fibonacci Series With Recursion Process .

## Fibonacci Sequence

The Fibonacci sequence is a set of numbers that starts with a one or a zero, followed by a one, and proceeds based on the rule that each number (called a Fibonacci number) is equal to the sum of the receding two numbers.

### Note:

This Can Be Done Very Easily Iteratively but It Takes More Time with Recursive Function, Best Approach Is to Do This Task Iteratively.

#### C++ Code With Recursion:

#include <iostream>

#include<chrono>    //Library For Calculating Time

unsigned fib(unsigned);  //Function Declaration

using namespace std;

int main(){

unsigned size , e=0;

cout<<"\t\t\t\tFibonacci Series Using Recursion Method !";

cout <<endl<< "Enter The Size  Of Series : ";

cin >> size;   //Input Size Of Series

cout << "\nFibonnaci Series : "<<endl<<"\t\t";

while(e < size) {

cout << " " << fib(e);    //Function Calling

e++;

}

unsigned time=chrono::duration_cast<chrono::nanoseconds>(r-q).count();//Calculating Time

cout<<endl<<endl<<endl<<"Execuation Time : "<<time<<" nanosecond(ns)";

return 0;

}

unsigned fib(unsigned  x)

{

if((x==1)||(x==0))

{

return(x);

}else{

return(fib(x-1)+fib(x-2));

}

}