✏️ Explanatory Question
Write a Java program that prints the diagonal elements of a square 2D array.
Given the following array:
int[][] matrix = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
Write a Java program that prints the diagonal elements of a square 2D array.
Given the following array:
int[][] matrix = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
Answer not available right now.
Sign in to save your progress and continue exactly where you left off.