# How to find transpose of a matrix in C programming?

its simple

just do this swappping

for(i=0;i<m;i++) /*A*/

for(j=0;j<i;j++) /*B*/

{

x=a[i][j];

a[i][j]=a[j][i];

a[j][i]=x;

}

I think A and B need a change :

/*Permutation : */

for ( i = 0 ; i <= lig ; i++ ) /*A*/

for ( j = 0 ; j <= i ; j++ ) /*B*/

{

int permut = MatA[i][j] ;

MatA[i][j] = MatA[j][i] ;

MatA[j][i] = permut ;

}

/*End of permutation */

printf("\nDISPLAY MATRIX : \n") ;

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

{

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

{

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

}

printf("\n") ;

}

### What is matrix programming in C programming?

C Examples on Matrix Operations A matrix is a rectangular array of numbers or symbols arranged in rows and columns. The following section contains a list of C programs which perform the operations of Addition, Subtraction and Multiplication on the 2 matrices. The section also deals with evaluating the transpose of a given matrix. The transpose of a matrix is the interchange of rows and columns.The section also has programs on finding the trace of…

### Write a c programme to read a matrix and print its transpose?

//matrix and its transpose #include<stdio.h> #include<conio.h> void main() { clrscr(); int m, n, c, d, matrix[10][10],transpose[10][10]; printf("Enter the number of rows and columns of matrix "); scanf("%d %d",&m, &n); //storing the elements of matrix printf("Enter the elements of matrix \n"); for( c = 0 ; c < n ; c++ ) { for( d = 0 ; d < m ; d++ ) { scanf("%d",&matrix[c][d]); } } printf("The matrix you have entered is:\n"); for( c…

### Write a C program to check whether the given matrix is symmetric or not?

First we find transpose of a matrix and then compare it with the original matrix. For a symmetric matrix A^T = A. Step 1 - Accepts a square matrix as input Step 2 - Create a transpose of a matrix and store it in an array Step 3 - Check if input matrix is equal to its transpose or not If it is equal, then the input square matrix is symmetric. Please find the program…

### Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix?

Sp[[Q/Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix|Answer]]ell chec[[Q/Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix&action=edit§ion=new|Answer it!]]k your answe[[Q/Discuss:Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix|Disc]][[help/answering questions|guidelin]]Spell check your answeresussionr[[help/signing in|full benefits]] Save C[[Q/Write a 8085 microprocessor program to find A inverse and A transpose…

### Write a program in c to find transpose of a matrix using functions?

#include <stdio.h> #include <conio.h> void transpose(int a[10][10],int ,int); /*Function prototype*/ void main() { int i,j,m,n; int a[10][10], b[10][10]; clrscr(); printf("Enter the order of matrix a\n"); scanf("%d %d", &m, &n); printf("Enter the elements of matrix\n"); for(i=0;i<m;i++) { for(j=0;j<n;j++) { scanf("%d",&a[i][j]); } } printf("Matrix a is\n"); for(i=0;i<m;i++) { for(j=0;j<n;j++) { printf("%3d",a[i][j]); } printf("\n"); } transpose(a,i,j)/*Function call*/ getch(); /* Finding Transpose of matrix*/ void transpose(int a[10][10],int m,int n)/*Function definition*/ for(i=0;i<m;i++) { for(j=0;j<n;j++) { b[i][j] = a[j][i]; } }…

### Write an Algorithm of transpose of sparse matrix?

Algorithm for the Transpose of a Sparse-Matrix: This is the algorithm that converts a compressed-column sparse matrix into a compressed-row sparse matrix. It computes number of rows in A, compares the cummulative sum to generate row pointers and then iterates over each nonzero entry in A, storing the entry in its corresponding row vector. If the matrix resulted in this procedure is a sparce matrix C and can be interpreted as a matrix in compressed-row…