c++ – Theoretical Analysis of Fibonacci series


Hello i am starting to learn c++. I am having trouble with time and complexity analysis. I have done fibonacci series in a recursive way. I think it is O(n^2). Can you find out the time analysis ? If possible, could you elaborate it?

#include<iostream>
using namespace std;

void fibonacci(int n,int n1,int n2)
{
    if(n==0)
    {
        cout<<endl<<n1;
        return;
    }
    else if(n==1)
    {
        cout<<endl<<n2;
        return;
    }
    fibonacci(n-1,n2,n1+n2);
    return;
}

int main()
{
    int n;
    cout<<"Enter the number:"<<endl;
    cin>>n;
    fibonacci(n,0,1);
    return 0;
}