answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

#include<math.h>

void main()

{

int a[10][10],sum=0,i,j,m,n,trace=0;

float norm;

printf("enter order");

scanf("%d %d",&m,&n);

printf("enter elements ");

for(i=0;i<m;i++)

{for(j=0;j<m;j++)

scanf("%d",&a[i][j]);

}

for(i=0;i<m;i++)

{

for(j=0;j<m;j++)

{

sum=sum+(a[i][j]*a[i][j]);

if(i==j)

trace=trace+a[i][j];

}

}

norm=sqrt(sum);

printf("norm=%f\n trace=%d",norm,trace);

}

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

RossRoss
Every question is just a happy little opportunity.
Chat with Ross
RafaRafa
There's no fun in playing it safe. Why not try something a little unhinged?
Chat with Rafa
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao

Add your answer:

Earn +20 pts
Q: C program to find trace and norm of a matrix?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you write a java package program for addition?

A number of well-tested open-source Matrix Java libraries are available. Best to find and use one that's been around for a while since most of the bugs have been worked out. If you need to write your own it's still worth-while to examine the APIs of those libraries first.JAMA is a free Java library for basic linear algebra and matrix operations developed as a straightforward public-domain reference implementation by MathWorks and NIST.Example of Use. The following simple example solves a 3x3 linear system Ax=b and computes the norm of the residual.double[][] array = {{1.,2.,3},{4.,5.,6.},{7.,8.,10.}};Matrix A = new Matrix(array);Matrix b = Matrix.random(3,1);Matrix x = A.solve(b);Matrix Residual = A.times(x).minus(b);double rnorm = Residual.normInf();


What is the importance of thread?

thread is a light weight program . concurrent execution of code can be done by usin threads.thread is a part of the program.


Explain Shearing and reflection as a technique of 2d transformation?

ShearingFor shear mapping (visually similar to slanting), there are two possibilities. For a shear parallel to the x axis has x' = x + ky and y' = y; the shear matrix, applied to column vectors, is: A shear parallel to the y axis has x' = xand y' = y + kx, which has matrix form:ReflectionTo reflect a vector about a line that goes through the origin, let be a vector in the direction of the line: To reflect a point through a plane ax + by + cz = 0 (which goes through the origin), one can use , where is the 3x3 identity matrix and is the three-dimensional unit vector for the surface normal of the plane. If the L2 norm of a,b, and c is unity, the transformation matrix can be expressed as:Note that these are particular cases of a Householder reflection in two and three dimensions. A reflection about a line or plane that does not go through the origin is not a linear transformation; it is an affine transformation.


What is the abbreviation of EN material?

En 8 Stands for Euro - NOrm


What psi is considered a high pressure pneumatic system?

factory air pressure norm is 80 psi