Menu
Question Index
...

Write a program to get the transpose of the given matrix.

Input (Two Dimensional matrix) Output (Two Dimensional matrix)
21 23 34 45 37
11 19 13 17 15
 9  6  7  5  1
101 99 77 33 121
25 56 44 22 66
21  11  9  101  25
23  19  6  99  56
34  13  7  77  44
45  17  5  33  22
37  15  1  121  66
10   2   5
7   13   9
6   8   11
10   7   6
2   13   9
5   9   11
99 101 111 121
10 66 77 89
133 144 168 177
99 10 133
101 66 144
111 77 168
121 89 177
12   23   45
89   99   100
12   89
23   99
45   100



class FindTransposeOfMatrix
{
    public static void main(String s[])
    {
        int input[][] = {{10, 2, 5}, {7, 13, 9}, {6, 8, 11}};
        int output[][] = getTransposeOfMatrix(input);
        System.out.println("The transpose matrix is : ");
        for (int[] array1d : output) {
        for (int element : array1d) {
        System.out.print(element + " ");
        }
        System.out.println();
        }

    }


    public static int[][] getTransposeOfMatrix(int matrix[][]) {
    }

}

Doubts

Problems

Topic: Learn Arrays And Loops

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App