package ifelse;
public class Task1 {
public static void main(String[] args) {
int row = 5;
int colum = 5;
int a = 0;
while (a < row) {
int b = 0;
while (b < colum) {
if ((a + b) % 2 == 0) {
System.out.print("1 ");
}
else
{
System.out.print("0 ");
}
b++;
}
System.out.println();
a++;
}
}
}
OUTPUT:
1 0 1 0 1
0 1 0 1 0
1 0 1 0 1
0 1 0 1 0
1 0 1 0 1
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
good try