#include <iostream>
using namespace std;
int fab(int n)
{
int *arr = new int[n];
arr[0] = 1;
arr[1] = 2;
int result = 0;
for(int i=2; i<n; ++i)
arr[i]= arr[i-1] + arr[i-2];
for(int i=0; i<n; ++i)
cout<<arr[i]<<" ";
delete []arr;
cout<<endl;
return 1;
}
int main()
{
fab(4);
return 0;
}
using namespace std;
int fab(int n)
{
int *arr = new int[n];
arr[0] = 1;
arr[1] = 2;
int result = 0;
for(int i=2; i<n; ++i)
arr[i]= arr[i-1] + arr[i-2];
for(int i=0; i<n; ++i)
cout<<arr[i]<<" ";
delete []arr;
cout<<endl;
return 1;
}
int main()
{
fab(4);
return 0;
}