for (int row = 1; row <= 3; row++) { for (int col = 1; col <= 2; col++) { System.out.println("Row " + row + ", Col " + col); } } // Output: // Row 1, Col 1 // Row 1, Col 2 // Row 2, Col 1 // Row 2, Col 2 // Row 3, Col 1 // Row 3, Col 2
Click Run to execute this code.