Contact Learn C
Copy

Program 137:To find Normal of Given matrix

Program 137:   
 
#include<stdio.h>
#include<math.h>
main()
{ 
 int i,j,rows,col,temp,sum=0;
 printf("Enter number of rows and columns of a matrix\n");
 scanf("%d %d",&rows,&col);
int a[rows][col];
double normal;

  //Taking input of matrix
    printf("Enter Matrix 1\n");
    for(i=0;i<rows;i++)
    {
       for(j=0;j<col;j++)
      {
     scanf("%d",&a[i][j]);
      sum+=(a[i][j]*a[i][j]);
      }
    }
    
    printf("Given /matrix is\n");
        for(i=0;i<rows;i++)
         {
         for(j=0;j<col;j++)
         {
           printf("%d\t",a[i][j]);
           }
  
           printf("\n");
           }
         
    normal=(double)sqrt(sum);
      printf("Normal of given matrix is %lf\n",normal);
      

}

Explanation:

 //Coming Soon

 Output:

To find Normal of Given matrix





























Donate

Download App and Learn when ever you want

Get it on PlayStore
Get it on Amazon App Store
Get it on Aptoide