Small error in pattern

#include
using namespace std;
int main() {
int n,n1=0,n2=1,n3;
cin>>n;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
if(i==1)
{
cout<<n1<<" “;
}
else if(i==2)
{
cout<<n2<<” “;
}
else{
n3=n1+n2;
n1=n2;
n2=n3;
cout<<n3<<” ";
}

	}
	cout<<endl;
}
return 0;

}

there is small change here:
…
else if(i==2)
{
//modify n1 here
n1 = 1;
cout<<n2<<" ";
}
…
we should modify n1 to continue the series.
please rate and resolve if satisfied.
thanks