Answer:
Check the explanation
Step-by-step explanation:
C code:
#include <stdio.h>
void cal_transpose(int arr1[3][3],int transpose[3][3])
{
for (int i = 0; i < 3; ++i)
for (int j = 0; j < 3; ++j) {
transpose[j][i] = arr1[i][j];
}
}
int main()
{
int arr1[3][3]={1,2,3,4,5,6,7,8,9};
int transpose[3][3];
cal_transpose(arr1,transpose);
printf("matrix arr1 : \\");
for (int i = 0; i < 3; ++i)
{ for (int j = 0; j < 3; ++j) {
printf("%d ",arr1[i][j]);
}
printf("\\");
}
printf("Transpose matrix : \\") ;
for (int i = 0; i < 3; ++i)
{
for (int j = 0; j < 3; ++j) {
printf("%d ",transpose[i][j]);
}
printf("\\");
}
return 0;
}
CODE OUTPUT: