Pascals triangle 1

below is my code i am getting my output right but it kept failing two test cases .
#include
using namespace std;

int main()
{

int N,row,col;
cin>>N;
for(row=1;row<=N;row++)
{
	for(col=1;col<=(N-row);col++)
	{
	cout<<" "<<" ";	
	}
	for(col=1;col<=((2*row)-1);col++)
	{
		if(row>1)
		{
	cout<<1<<" ";
	for(col=1;col<=((2*row)-3);col++)
	{
		if(col%2==0)
		{
			cout<<row-1<<" ";
		}
		else 
		{
			cout<<" "<<" ";
		}
	}
	}
	cout<<1<<" ";
	break;
	}
	cout<<endl;
}
return 0;

}

please help me to solve this problem
thanking you in advance

hey @AKSHET pascal traiangle is not what you are printing.your code is only giving correct output for N<=4.
for N=5 answer should be this:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1

but your code is giving this
1
1 1
1 2 1
1 3 3 1
1 4 4 4 1 read problem statement carefully.

Thanks for the instant help

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.