answersLogoWhite

0


Best Answer

void main()

{

int arr[4][4];

int i,j,a,b,f;

printf("\nInput numbers to 4*4 matrix");

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

{

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

{

printf("\nKey in the [%d][%d]) value",i+1,j+1);

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

}

}

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

{

for(j=0,f=0;j<4;j++)

{

if(i!=j&&f==0)

continue;

a=arr[i][j];

b=arr[j][i];

arr[i][j]=b;

arr[j][i]=a;

f=1;

}

}

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

{

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

printf("%d ",arr[j][i]);

printf("\n");

}

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

trace of a matrix using functions in c language

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to obtain transpose of a 4 X 4 Matrix in c using functions?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Obtain a transformation which will diagonalize the matrix?

consider a matrix Aobtain a transformation which will diagonalize the matrix.Whatare the coordinates of an arbitrary vectora=traspos(x,y,z)with respect to the basis set which diagonalizes A?


where is the read of chattanooga program?

The Read 20 program in Chattanooga, Tennessee is an early literacy initiative that promotes reading for children and families throughout the community. It partners with schools, community organizations, and volunteers to provide resources and support for developing strong reading skills in children from an early age. You can find more information about the program on their website or by contacting local libraries and schools in Chattanooga.


What are the basic functions of cellular respiration?

see link below To obtain energy from food.


What parts of the animal are involve to obtain its food?

ALL parts save for the reproductive functions.


What happens to an organism if it does not obtain energy?

The organism will surely die if it does not obtain energy since it needs energy to carry out everyday functions.


How is the program of pso written in in matlab...For eg i want to obtain optimal position for svc for voltage stability..how will b program..also how to create that program from algorithm..?

The program of PSO in Matlab to obtain optimal position for SVC voltage stability will need written in the standard format beginning with the stability grid.


What are the functions of corporate manager?

Planning, managing and controlling resource's to obtain goals and survive in a competitive environment


What is the National Merit Scholarship program?

The National Merit Scholarship Program is a prestigious academic competition for high school students in the United States. Participants are evaluated based on their PSAT scores, academic record, extracurricular activities, and an essay. Finalists can earn scholarships for college based on their performance in the competition.


How long does it takes to obtain psychology masters?

In order for one to obtain a Masters in Psychology there are several years of education required. One has to initially complete an undergraduate program that lasts 4 years before entering into the graduate level degree to obtain the Masters. This is an additional 2 to 3 years, so the full duration for this program would be 6 or 7 years. One could then continue on to a Doctorate program if desired.


Can you obtain AIRMILES when you shop Bose Canada?

Yes you can obtain air miles when you or shop Bose Canada. They are one of the companies that offers that program to there customers around the world.


Why is extracellular matrix made from pig bladder?

Availability and the pig bladder has the extracellular matrix, so it can regenerate itself. There are hundreds of thousands of pigs, slaughtered every year for food. The bladders are not considered food, so they are thrown away. Which makes them readily available and cheap to obtain. Your liver is an organ that has the matrix and can regenerate itself, but operations are expensive and the donor might not survive the operation.


What button can obtain the average and total in Excel?

The Autosum buttons allows to you to total and average. It also allows you to do other functions.