Unable to pass the test cases

i am unable to run the testcases in the given problem,Can you Please correct me
#include
using namespace std;
main()
{
int i,j;
for(i=0;i<5;i++)
{
if(i==0 || i==1)
{
for(j=0;j<=i;j++)
{
cout<<“1”;
}
}
else
{
for(j=0;j<=i;j++)
{
if(j==0|| j==i)
{
cout<<i;
}
else
{
cout<<“0”;
}
}
}
cout<<endl;

}
}

Hi @tharun
In this ques you have to take n as input and then run the main for loop from i=0 to i=n-1
And also in the if(i==0 || i==1) you need to add i%2==0. And lastly in the if condition of else condition instead of printing i you need to print 1.

Here is your corrected code :

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.