For this Question: Given a matrix of size N*N, your task is to find the sum of the primary and secondary diagonal of the matrix.

For Matrix:-
M<sub>00</sub> M<sub>01</sub> M<sub>02</sub>
M<sub>10</sub> M<sub>11</sub> M<sub>12</sub>
M<sub>20</sub> M<sub>21</sub> M<sub>22</sub>

Primary diagonal:- M<sub>00</sub> M<sub>11</sub> M<sub>22</sub>
Secondary diagonal:- M<sub>02</sub> M<sub>11</sub> M<sub>20</sub>The first line of input contains a single integer N, The next N lines of input contains N space-separated integers depicting the values of the matrix.

Constraints:-
1 <= N <= 500
1 <= Matrix[][] <= 100000Print the sum of primary and secondary diagonal separated by a space.Sample Input:-
2
1 4
2 6

Sample Output:-
7 6

Sample Input:-
3
1 4 2
1 5 7
3 8 1

Sample Output:-
7 10, I have written this Solution Code: import java.io.*;
import java.util.*;



 class Main {
	public static void main (String args[])throws Exception {


                    InputStreamReader inr= new InputStreamReader(System.in);
                    BufferedReader br= new BufferedReader(inr);
                    String str=br.readLine();
                    int row = Integer.parseInt(str);
                    int col=row;
                    int [][] arr=new int [row][col];
                    for(int i=0;i<row;i++){
                        String line =br.readLine();
                        String[] elements = line.split(" ");
                        for(int j=0;j<col;j++){
                            arr[i][j]= Integer.parseInt(elements[j]);
                        }
                    }

                  int sumPrimary=0;
                  int sumSecondary=0;
                  for(int i=0;i<row;i++){
                      sumPrimary=sumPrimary + arr[i][i];
                      sumSecondary= sumSecondary + arr[i][row-1-i];
                  }

                  System.out.println(sumPrimary+ " " +sumSecondary);
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?