1. Engineering
  2. Computer Science
  3. help me trace this code...

Question: help me trace this code...

Question details

38. Suppose mat is declared as int [3] [4]; mat new int [ ] [ ] If mat initially contains 2 1 3 4 9721 0 2 5 6 what is the output of the following code segment? for (int r= 1; r < ma t.length; r++) for (int c = 1; c < mat [0].length; c++) if ((r + c) % 2-0) mat [r] [c] 2 mat[r - * 1] [c - 1] + c; = System.out.printin (mat [2] [2]); (A) 5 (B) 11 (C) 12 (D) 15 (E) 16

Help me trace this code?

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution