In another ides my code is running right but here its showing some error.(question - manmohan loves pattern 1)

#include
using namespace std;
int main() {

int n=6;
cout<<“1”<<endl;
for(int i=2;i<=n;i++){
cout<<“1”;
for(int j=1;j<=i-2;j++)
{ if(i%2!=0){
cout<<“1”;
}
else{cout<<“0”;}

}
cout<<"1"<<endl;

}
return 0;
}

you are initializing n=6 instead you need to take input from the use by using cin>>n and the commas used in the code are wrong use double quotes " ".Rest everthing is working fine .modified code is here https://ide.codingblocks.com/s/217531

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.