Transpose part of logic

not able tot understand how we are implementing the transpose of the matrix

@chitranshanmol07 in transpose A(i,j) is becomes A(j,i), so just swap(A[i][j],A[j][i]).
Also do it for elements above diagonal only (because if you do it for whole matrix then changes are nullified!)