Not executing properly

#include
using namespace std;
int main()
{
int n;
cin>>n;
int row=1;
while(row<=n)
{
int col=1;
if (row%2!=0)
{
while(col<=row)
{
cout<<1;
col=col+1;
}}
else{
cout<<“1”;
while(col=row-2){
cout<<“0”;
col=col+1;
}
cout<<“1”;

		}
		cout<<endl;
		row=row+1;
		
}

return 0;

}

@Anku47 corrected code


dont forget to hit like and mark resolved if cleared :smiley:

1 Like

what was the error sir?

@Anku47 in while loop col=row-2 but it should be less than equal