Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a program to calculate the transpose of a hardcoded 2D array.

Medium

Problem Statement

Write a program to calculate the transpose of a hardcoded 2D array.

Sample Input

Matrix:
[ [1, 2, 3],
 [4, 5, 6],
 [7, 8, 9] ]

Sample Output

Transposed Matrix:
1 4 7 
2 5 8 
3 6 9 

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
using System; class TransposeMatrix { static void Main() { // Calculate the transpose of the matrix } }
Log in or sign up to run or submit your code.Log inSign up
Input
Matrix:
[ [1, 2, 3],
 [4, 5, 6],
 [7, 8, 9] ]
Expected Output
Transposed Matrix:
1 4 7 
2 5 8 
3 6 9