fibonacci recursion c++ code example
Example: tribonacci series c++
int n;
cin>>n;
int a=0,b=0,c=1;
if (n < 3) return 0;
cout<<a<<" "<<b<<" "<<c<<" ";
for(int i = 1; i<= n-3; i++){
int d = a + b + c;
cout<<d<<" ";
a = b;
b = c;
c = d;
}