Manmohan loves s

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

}
return 0;

}

sir pta hi nhi chl raha galti kya hai saare ans sahi aa rahe hai

hello @ahujaxrhythm

pls saVE this code on cb ide and share its link with me

check now->

no need of space(check output format).

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.