Sir ,no error but program is not output pls check

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

			while(j<=i-2)
			{	
			cout<<"0";
			}
			cout<<"1";
		}
		
	}
	cout<<endl;
}

return 0;
}

Hey @suraj1js18cs167
Please share your code in CB ide

Hey @suraj1js18cs167

#include <iostream>
using namespace std;
int main() {
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=i;j++)
		{
			if(i%2!=0)
			{
				cout<<"1";
			}
			else{
				if(j==i||j==1) //added this
				cout<<"1";
				else  //updated this instead of while loop
				{	
					cout<<"0";
				}
				// cout<<"1"; removed this
		}	
	}
	cout<<endl;
}
return 0;
}

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.