What is wrong with this code

#include
using namespace std;
int fact(int n)
{
if(n==0||n==1)
{return 1;
}
return n*fact(n-1);
}
int nCr(int n,int r)
{
return fact(n)/(fact®*fact(n-r));
}
int main() {
long int n;
cin>>n;
for(int i=0;i<n;i++)
{
for(int j=0;j<n-i;j++)
{
cout<<" “;
}
for(int k=0;k<=i;k++)
{
cout<<” "<<nCr(i,k);
}
cout<<endl;
}
return 0;
}

@Kunalgoyal
Your logic was correct.
But there was some issue with testcase, when n==1 the ans was 1 and our code was doing 1 and then endl.
i just handled it manually and it worked.