From e7b3965a7f268266946b10227b5bc163b4968a69 Mon Sep 17 00:00:00 2001 From: Komal Gupta Date: Tue, 25 May 2021 13:16:55 +0530 Subject: [PATCH 1/3] Create Diagnol_sum_of_matrix_elements.cpp --- .../Diagnol_sum_of_matrix_elements.cpp | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 Matrix_programs/Diagnol_sum_of_matrix_elements.cpp diff --git a/Matrix_programs/Diagnol_sum_of_matrix_elements.cpp b/Matrix_programs/Diagnol_sum_of_matrix_elements.cpp new file mode 100644 index 0000000..5e4d797 --- /dev/null +++ b/Matrix_programs/Diagnol_sum_of_matrix_elements.cpp @@ -0,0 +1,84 @@ +/* +Find sum of left and right diagonals of a matrix : +--------------------------------------- +Input the size of the square matrix : 4 +Input elements of matrix : +2 +4 +3 +4 +2 +5 +7 +5 +8 +9 +3 +5 +8 +9 +5 +1 +The matrix is : + 2 4 3 4 + 2 5 7 5 + 8 9 3 5 + 8 9 5 1 +Addition of the Right Diagonal elements is :11 +Addition of the left Diagonal elements is :28 +*/ +#include +void main() + { + int i,j,a[50][50],sum=0,n,m=0,sum1; + + printf("\n\nFind sum of left and right diagonals of a matrix :\n"); + printf("---------------------------------------\n"); + + printf("Input the size of the square matrix : "); + scanf("%d", &n); + m=n; + printf("Input elements of matrix :\n"); + for(i=0;i Date: Tue, 25 May 2021 13:41:03 +0530 Subject: [PATCH 2/3] Rename Diagnol_sum_of_matrix_elements.cpp to Diagnol_sum_of_matrix_elements.c --- ...um_of_matrix_elements.cpp => Diagnol_sum_of_matrix_elements.c} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Matrix_programs/{Diagnol_sum_of_matrix_elements.cpp => Diagnol_sum_of_matrix_elements.c} (100%) diff --git a/Matrix_programs/Diagnol_sum_of_matrix_elements.cpp b/Matrix_programs/Diagnol_sum_of_matrix_elements.c similarity index 100% rename from Matrix_programs/Diagnol_sum_of_matrix_elements.cpp rename to Matrix_programs/Diagnol_sum_of_matrix_elements.c From f67a88feafcf2a1f36186ad983a1c74396d90fcc Mon Sep 17 00:00:00 2001 From: Komal Gupta Date: Tue, 25 May 2021 13:41:23 +0530 Subject: [PATCH 3/3] Rename Transpose_of_matrix.cpp to Transpose_of_matrix.c --- .../{Transpose_of_matrix.cpp => Transpose_of_matrix.c} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Matrix_programs/{Transpose_of_matrix.cpp => Transpose_of_matrix.c} (100%) diff --git a/Matrix_programs/Transpose_of_matrix.cpp b/Matrix_programs/Transpose_of_matrix.c similarity index 100% rename from Matrix_programs/Transpose_of_matrix.cpp rename to Matrix_programs/Transpose_of_matrix.c