Hello, good as I show the upper triangle of this matrix, thank you!
System.out.println("Mostra la matriu");
for (int i = 0; i < mat.length; i++) {
for (int j = 0; j < mat[i].length; j++) {
System.out.print(mat[i][j] + "\t");
}
System.out.println();
}
I would like the upper right triangle, the diagonal of the matrix up.
Given the matrix:
1234
5678
9012
3456
I would like to get the matrix:
1234
678
12
6