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

Back to Lab Problems
Sorting and 2d Arrays/Geometry/Problem #3

Lab Problem Statement

Specifications & Problem DetailsIIT Kharagpur PDS Archive
Loading question...

Interactive C Compiler · Problem #3

WASM In-Browser

Runs directly on your machine · Zero remote server dependency

Compiler downloads on first Run (large, saved in your browser after that)
main.cCtrl + Enter to run
1
2
3
4
5
6
7
Input (stdin)given to scanf / cin
Output

Output appears here. Press Run to compile and execute.