What value is stored at arr[1][2] after executing the following code snippet: int[][] arr = {{1,2,3}, {4,5,6}, {7,8,9}};?

  • 3
  • 6
  • 8
  • 9
The given code initializes a 2D array arr. arr[1] represents the second row (index 1), and arr[1][2] represents the third element in that row, which is 8. So, 8 is stored at arr[1][2].
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *