0

Write a c program of 3*3 and find transpose of matrix without using another matrix?

Suppose Matrix a: Transpose of a: 1 2 3 1 5 8 5 6 7 2 6 9 8 9 0 3 7 0

8th Dec 2021, 5:19 AM
Simi Jain
2 Réponses
+ 2
If it will always be a 3 * 3 matrix and no other size will be used then; Swap [0][1] with [1][0], [0][2] with [2][0], and [1][2] with [2][1] and it's done.
8th Dec 2021, 5:56 AM
ChaoticDawg
ChaoticDawg - avatar
0
Transposing is a matter of swapping indices. If you read the values in as matrix[i][j], then print them out as matrix[j][i].
8th Dec 2021, 7:17 AM
Brian
Brian - avatar