#include<conio.h>
#include<stdio.h>
#include<math.h>
int main()
{
int i,j,m,n;
int mat[10][10];
double s,nm;
printf("\n Enter the no. of rows and columns : ");
scanf("%d %d",&m,&n);
s = 0;
for(i=0;i<m;i++)
{
printf("Row %d : ",i+1);
for(j=0;j<n;j++)
{
scanf("%d",&mat[i][j]);
s += pow(mat[i][j],2);
}
}
nm = sqrt(s);
printf("\n\nThe Norm of this matrix : %lf",nm);
getch();
return 0;
}
No comments:
Post a Comment