Menu
Question Index
...

Write a program to find if the given matrix is symmetric. Assume that the input matrix is a square matrix.

Input (Two Dimensional matrix) Output (boolean)
5   8   3
8   0   4
3   4   0
true
-3   5   6   7
5   0   9   45
6   9   0   32
7   45   32   0 
true
1   0
0   1
true
12   89   77
23   99   66
45   100   111
false
1   0
-1   0
false



class IsSymmetricMatrix
{
    public static void main(String s[])
    {
        int input[][] = {{5, 8, 3}, {8, 0, 4}, {3, 4, 0}};
        System.out.println("Is symmetric matrix : " + isSymmetric(input));

    }


    public static boolean isSymmetric(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