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

Programming Exercises

Create a program to find the transpose of a 2D array.

Easy

Problem Statement

Create a program to find the transpose of a 2D array.

Sample Input

2D array = {{1, 2}, {3, 4}}

Sample Output

Transpose = 
1 3 
2 4 

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <iostream> int main() { int arr[2][2] = {{1, 2}, {3, 4}}; // Logic to find transpose return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
2D array = {{1, 2}, {3, 4}}
Expected Output
Transpose = 
1 3 
2 4