Sorting and 2d Arrays – Geometry – Problem #3
IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive
Difficulty: medium
Problem Statement
Write a program which reads an integer n, and then reads a n x n integer matrix. The program should then print the transpose of this matrix. If A' is a transpose of the matrix A, then A[i][j] = A[j][i]. Print the original and the transposed matrix in the usual matrix format. For example, if n = 2, and the input matrix is : 1 2 3 4 the output matrix is : 1 3 2 4