Matrix

It reads a square matrix of order n from keyboard.
Order in ascending order main diagonal elements.

for example:
n=3
matrix is this
4 9 2
1 8 7
2 8 1

after solving it should look like this:
1 9 2
1 4 7
2 8 8

Any ideeas?
closed account (D80DSL3A)
Can you sort a 1-D array in ascending order? Do the same with M[0][0], M[1][1],...,M[n-1][n-1].
Topic archived. No new replies allowed.