Consider the following code segment: int[][] mat = new int[3][4]; for (int row = 0; row <
Fantastic news! We've Found the answer you've been seeking!
Question:
Consider the following code segment:
int[][] mat = new int[3][4];
for (int row = 0; row < mat.length; row++) {
for (int col = 0; col < mat[0].length; col++) {
if (row < col) {
mat[row][col] = 1;
}
else if (row == col) {
mat[row][col] = 2;
}
else {
mat[row][col] = 3;
}
}
}
What are the contents of mat after the code segment has been executed?
Related Book For
College Mathematics For Business Economics, Life Sciences, And Social Sciences
ISBN: 978-0134674148
14th Edition
Authors: Raymond Barnett, Michael Ziegler, Karl Byleen, Christopher Stocker
Posted Date: