134. C Program to Find the Normal of A Matrix.
How does this program work?
- In this programme you will learn about how to find norm of matrix using C Language.
- variables are stored in two arrays.
- And then by using formula finding the normal of the given matrix.
Here is the code
#include <stdio.h>
int main(void)
{
static int array[10][10];
int i, j, m, n, sum1 = 0, a = 0, normal;
printf("Enter the order of the matrix \n");
scanf("%d %d", &m, &n );
printf("Enter the coefficients of %d*%d matrix \n",m,n );
for (i = 0; i < m; ++i)
{
//Compute normal
for(j = 0; j < n; ++j)
{
scanf("%d", &array[i][j] );
a = array[i][j] * array[i][j];
sum1 = sum1 + a;
}
}
normal= sqrt((double)sum1);
printf("The normal of the given matrix is = %d\n", normal);
return 0;
}