Print pascals triangle

what is wrong in my code ,all the test cases are getting failed.
#include
using namespace std;
int fact(int n){
int i=2,f=1;
for(int i=2;i<=n;i++){
f=f*i;
}
return f;
}
int main() {
int n;
cin>>n;
for(int i=0;i<n;i++){
for(int j=0;j<=i;j++){
int p=i-j;
int s=fact(i)/(fact§*fact(j));
cout<<s;

	}
	cout<<endl;
}

}

ur o/p
image

expected o/p in the following way
image
u will have to give proper spacing…

here’s ur corrected code https://ide.codingblocks.com/s/627074

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.