Untitled

 avatar
user_7016102
plain_text
a month ago
355 B
2
Indexable
Never
//LAB 7
#include<iostream>
using namespace std;
int fabi(int n)
{
	if(n==0)
	{
		return 0;
	}
	else if(n==1){
		return 1;
	}
	else{
		return fabi(n-1)+fabi(n-2);
	}
}
int main()
{
	int n,i;
	cout<<"Enter the number : ";
	cin>>n;
	cout<<"The fibonacci of "<<n<<": "<<endl;
	for(i=0;i<n;i++){
		cout<<fabi(i)<<"\t";
	}
	return 0;
}
Leave a Comment