[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/Skm26/basic-programs/master/java/SymmetricMatrix.java [Back]  [Original]

/* 
*   Program checks if Matrix is symmetric or not and finds the sum of left and right diagonals
*	  Accept size M
* 	Input values in array
*  	Display original matrix
* 	Check if marix is symmetric
* 	Add left diagonal elements and right diagonal elements
* 	Display if the matrix is symmetric or not
* 	Print sum of left and right diagonal elements
*/


import java.util.*;
class SymmetricMatrix
{
    void main()
    {
        int M; 
        int arr[][];
        Scanner sc=new Scanner(System.in);
        System.out.println("Enter number of rows and coloumn");
        M=sc.nextInt();
        arr=new int[M][M];
        if( M

Web Proxy Viewer  |  New URL  |  Original Page