Posted in: C Language

C Program to Print Transpose of Matrix using Array

For writing this program you need to have knowledge in order to write a program that can transpose a given matrix using Array:

Meaning of Transpose :

In Matrices, Transpose means to interchange the elements of a matrix.

Algorithm :

  1. START
  2. Read value of the array using Nested loop
  3. Interchange the value of row variable with column variable while printing
  4. Write the Transpose of matrix
  5. STOP

C Program :

  1. #include <stdio.h>
  2. #include <conio.h>
  3. int main()
  4. {
  5. int matt[3][3],i,j;
  6.  
  7. printf("Enter the elements of Matrix :\n");
  8. for(i=0; i<3; i++)
  9. {
  10. for(j=0; j<3; j++)
  11. {
  12. scanf("%d", &matt[i][j]);
  13. }
  14. printf("\n");
  15. }
  16. printf("Transpose of given matrix : \n");
  17. for(int a=0; a<3; a++)
  18. {
  19. for(int b=0; b<3; b++)
  20. {
  21. printf("%d\t", matt[b][a]);
  22. }
  23. printf("\n");
  24. }
  25. printf("Visit https://codewin.org for programming tutorials");
  26. getch();
  27. }

Result :

Download :

Raw Code

C Program File