Pascal triangle, what is the mistake in this ? plz help

#include
using namespace std ;

int fac(int a)
{
int i,k=1;
for(i=a;i>0;i–)
{
k=k*i;
}
return k;
}

int main()
{
long long int i,j,s,d,n,sp;
cin>>n;
for(i=0;i<=n;i++)
{
for(sp=1;sp<=(n-i);sp++)
{
cout<<" ā€œ;
}
for(j=0;j<=i;j++)
{ d=i-j;
s=(fac(i))/(fac(d)*fac(j));
cout<<s<<ā€ ";
}cout<<endl;
}
}

Hey @345avamanverma your code is printing one extra line than the required amount. So you need to run your main loop one less time, use this for(int i=0;i<n;i++) . Then it works fine.
If you have any further queries please feel free to ask