From 68b3300ca3df7733d23b494e688899658ce55859 Mon Sep 17 00:00:00 2001 From: Ankit-5087 <85407190+Ankit-5087@users.noreply.github.com> Date: Tue, 5 Oct 2021 17:50:25 +0530 Subject: [PATCH] Create MatrixDiagSum.java Java based program to find the sum of the diagonals of the entered matrix. --- MatrixDiagSum.java | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 MatrixDiagSum.java diff --git a/MatrixDiagSum.java b/MatrixDiagSum.java new file mode 100644 index 0000000..6e6ba8b --- /dev/null +++ b/MatrixDiagSum.java @@ -0,0 +1,40 @@ +// Contributor Info : +// Name : Ankit Raj +// Git : https://github.com/Ankit-5087 + +import java.util.*; +class array2D_diag + + +{ + public static void main(String args[]) + { + Scanner sc=new Scanner(System.in); + int n=4; + int num[][]=new int[n][n]; + for (int r=0;r