i am failing 1 of the testcase .Kindly see d code.
package krish;
import java.util.Scanner;
public class ManmohanlovesPattern1 {
public static void main(String[] args)
{
int n;
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
if(n>=1&&n<=1000)
{
for(int i=1;i<=3;i++)
{
for(int j=1;j<=i;j++)
{
if(i==1||i==2||i==3)
{
System.out.print(1);
}
}
System.out.println();
}
for(int k=4;k<=n;k++)
{
for(int s=1;s<=k;s++)
{
if(k%2==0)
{
if(s==1||s==k)
System.out.print(1);
else
System.out.print(0);
}
else
System.out.print(1);
}
System.out.println();
}
}
else
System.out.print("wrong choice");
}
}