Write a program in java to print the following pattern:
9 8 7
6 5 4
3 2 1
Answers
Answered by
0
Explanation:
public class DisplayMatrix {
public static void main(String[] args) {
int matrix[][] =
{ { 9,8,7}, { 6,5,4 }, { 3,2,1 } };
for(int i=0; i<matrix.length; i++) {
for(int j=0; j<matrix[0].length; j++) {
System.out.print(matrix[i][j] + " ");
}
System.out.println();
}
}
}
Output
987
654
321
Similar questions