-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstar 13.txt
More file actions
50 lines (45 loc) · 772 Bytes
/
Copy pathstar 13.txt
File metadata and controls
50 lines (45 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* 10101
01010
10101
01010
10101 */
import java.util.Scanner;
class Star13
{
public static void main(String[] args)
{
Scanner s=new Scanner(System.in);
System.out.println("enter no of lines");
int n=s.nextInt();
for(int j=1;j<=n;j++)
{
for(int i=0;i<=n;i++)
{
System.out.print((i+j)%2+"");
}
System.out.println();
}
}
}
/*
OR
import java.util.Scanner;
class Star13
{
public static void main(String[] args)
{
Scanner s=new Scanner(System.in);
System.out.println("enter no of lines");
int n=s.nextInt();
int count=1;
for(int j=1;j<=n;j++)
{
for(int i=1;i<=n;i++)
{
System.out.print(count%2+"");
count++;
}
System.out.println();
}
}
}