Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

transpose of matrix using c program

#include<stdio.h>
int main()
{
  int n,m,a[100][100],i,j;
  printf("Enter row and col:");
  scanf("%d%d",&n,&m);
  printf("Matrix A :
");
  for(i=0;i<n;i++)
    {
      for(j=0;j<m;j++)
        {
          printf("a[%d][%d] :",i,j);
          scanf("%d",&a[i][j]);
        }
    }

  printf("Transpose of Matrix :
");
  for(i=0;i<n;i++)
    {
      for(j=0;j<m;j++)
        {
          printf("%d 	",a[j][i]);
        }
      printf("
");
    }
  
}
 
PREVIOUS NEXT
Tagged: #transpose #matrix #program
ADD COMMENT
Topic
Name
7+6 =