From 0240becf57423aabf2b9eb783399b2f094b6e670 Mon Sep 17 00:00:00 2001 From: Somyajit Chakraborty Date: Sun, 17 Oct 2021 09:40:15 +0530 Subject: [PATCH] Create norm_matrix.C --- C/norm_matrix.C | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 C/norm_matrix.C diff --git a/C/norm_matrix.C b/C/norm_matrix.C new file mode 100644 index 0000000..dec2083 --- /dev/null +++ b/C/norm_matrix.C @@ -0,0 +1,81 @@ +/* find the norm of a matrix using dynamic memory allocation*/ +#include +#include +#include + + +/*The driver code*/ +int main(void) +{ + int **array, *norm; + int i, j, m, n, max; + + /*Taking the number of rows and colums from the user*/ + printf("Enter the number of rows and cols of matrix:"); + scanf("%d%d", &m,&n); + + /*dynamic memory allocation*/ + array=(int **)malloc(m*sizeof(int *)); + + for(i=0;i