#include
using namespace std;
int main()
{
int n;
cin>>n;
int col=1;
int row=1;
while(row<=n)
if (row%2!=0)
{
cout<<“1”;
col=col+1;
}
else
{
cout<<“1”;
while(col=row-2)
cout<<“0”;
}
cout<<“1”;
row=row+1;
return 0;
}
#include
using namespace std;
int main()
{
int n;
cin>>n;
int col=1;
int row=1;
while(row<=n)
if (row%2!=0)
{
cout<<“1”;
col=col+1;
}
else
{
cout<<“1”;
while(col=row-2)
cout<<“0”;
}
cout<<“1”;
row=row+1;
return 0;
}
@Anku47 look at the video of this problem. it has explained simply there and try to write code as per video.
but i am not getting that where i am wrong?
in which part have i made a mistake?
give braces for your first while loop and update the conditions of 2nd while loop as per video.