code:
import java.util.*;
public class Main {
public static void main(String args[]) {
// Your Code Here
Scanner scn=new Scanner(System.in);
int n= scn.nextInt();
int nst=1;
int row=1;
while(row<=n)
{
if(row%2==0 && row>=4)
{
System.out.print(“1”);
for(int cst=1;cst<=nst-2;cst++)
{
System.out.print(“0”);
}
System.out.print("1");
}
else
{
for(int csp=1;csp<=nst;csp++)
{
System.out.print("1");
}
}
}
nst++;
System.out.println();
row++;
}
}
error is:
infinte loop of 1 as output