Write A C Program To Find Out Transport Of A Matrix

Write A C Program To Find Out Transport Of A Matrix



Solution:

#include<stdio.h>
int main(){
  int a[10][10],b[10][10],i,j,k=0,m,n;
  printf("\nEnter the row and column of matrix");
  scanf("%d %d",&m,&n);
  printf("\nEnter the First matrix->");
  for(i=0;i<m;i++)
      for(j=0;j<n;j++)
           scanf("%d",&a[i][j]);
  printf("\nThe matrix is\n");
  for(i=0;i<m;i++){
      printf("\n");
      for(j=0;j<m;j++){
           printf("%d\t",a[i][j]);
      }
  }
  for(i=0;i<m;i++)
      for(j=0;j<n;j++)
           b[i][j]=0;
  for(i=0;i<m;i++){
      for(j=0;j<n;j++){
           b[i][j]=a[j][i];
           printf("\n%d",b[i][j]);
      }
  }
  printf("\n\nTraspose of a matrix is -> ");
  for(i=0;i<m;i++){
      printf("\n");
      for(j=0;j<m;j++){
           printf("%d\t",b[i][j]);
      }
  }
  return 0;
}

More C Program :


  1. Write a c program to find out transport of a matrix
  2. c program to find transpose of a matrix without using another matrix
  3. write a program to find transpose of a matrix using function
  4. program to find transpose of a matrix in c++
  5. multiplication of a matrix in c
  6. transpose of a matrix in c without using second matrix
  7. transpose of a matrix in c using pointers
  8. write a program to find the inverse of a matrix
  9. transpose of a 3x3 matrix in c


Learn More :