#include <stdio.h>
void main ()
{
static int ma[10][10];
int i,j,m,n;
printf (“Enter the order of the matrix \n”);
scanf (“%d %d”,&m,&n);
printf (“Enter the coefficients of the matrix\n”);
for (i=0;i<m;++i)
{
for (j=0;j<n;++j)
{
scanf (“%d”,&ma[i][j]);
}
}
printf (“The given matrix is \n”);
for (i=0;i<m;++i)
{
for (j=0;j<n;++j)
{
printf (” %d”,ma[i][j]);
}
printf (“\n”);
}
printf (“Transpose of matrix is \n”);
for (j=0;j<n;++j)
{
for (i=0;i<m;++i)
{
printf (” %d”,ma[i][j]);
}
printf (“\n”);
}
} /* End of main() */
/*——————————————
Output
Enter the order of the matrix
2 2
Enter the coefficients of the matrix
3 -1
6 0
The given matrix is
3 -1
6 0
Transpose of matrix is
3 6
-1 0
——————————————-*/
Not Satisfied ? Just search & get the result
Related posts:
- C program to read A (MxN), find the transpose of a given matrix and output both the input matrix and the transposed matrix.
- C program to accept a matrix of order MxN and find the trace and normal of a matrix HINT:Trace is defined as the sum of main diagonal elements and Normal is defined as square root of the sum of all the elements
- C program to accept a matrix of order M x N and find the sum of each row and each column of a matrix
- C program to read two matrices A (MxN) and B(MxN) and perform addition OR subtraction of A and B. Find the trace of the resultant matrix. Output the given matrix, their sum or Differences and the trace.
- C program to find accept a matrix of order M x N and find the sum of the main diagonal and off diagonal elements

{ 1 trackback }