- Home
- Course Category
- Course Result
- Course Detail
Hot Line: 0124-2383121
Course Introduction
Includes
Certificate & Practice Material
Programs for practice
In the program below, we've introduced beginers to programming in C
Source Code: Program to find transpose of a matrix
# Program to find transpose of a matrix in C #include<stdio.h> void main() { int m, n, c, d, matrix[10][10], transpose[10][10]; printf("Enter the number of rows and columns of matrix\n"); scanf("%d%d", &m, &n); printf("Enter the elements of matrix\n"); for (c = 0; c < m; c++) for(d = 0; d < n; d++) scanf("%d",&matrix[c][d]); for (c = 0; c < m; c++) for( d = 0 ; d < n ; d++ ) transpose[d][c] = matrix[c][d]; printf("Transpose of entered matrix :-\n"); for (c = 0; c < n; c++) { for (d = 0; d < m; d++) printf("%d\t",transpose[c][d]); printf("\n"); }Output
Run the program to see the OUTPUT