#Values in array by row

1 messages ยท Page 1 of 1 (latest)

coarse currentBOT
#

<@&987246399047479336> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question ๐Ÿค–. Maybe it helps! In any case, a human is on the way ๐Ÿ‘. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#

c static void main(String[] args) {
int[][] array = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}};

    for (int row = 0; row < array.length; row++) {
        for (int column = 0; column < array[row].length; column++) {
            System.out.printf("%d ", array[row][column]);
        }
        System.out.println();
    }
}

}


The expected output according to the book is:

1 2 3
4 5 6
7 8 9
10 11 12


But my output is:

1
2
3
4
5
6
7
8
9
10
11
12


What am I doing wrong?