9.1.7 Checkerboard V2 Codehs -

If row % 2 == 1 , start with the opposite color. Equivalent to:

private static final int NUM_ROWS = 8; private static final int NUM_COLS = 8; 9.1.7 Checkerboard V2 Codehs

System.out.print("Enter number of rows: "); int rows = input.nextInt(); System.out.print("Enter number of columns: "); int cols = input.nextInt(); for (int i = 0; i < rows; i++) for (int j = 0; j < cols; j++) if ((i + j) % 2 == 0) System.out.print("@"); else System.out.print("."); System.out.println(); // new line after each row If row % 2 == 1 , start with the opposite color