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