forked from gne-ldh/PPS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP33.c
More file actions
35 lines (35 loc) · 828 Bytes
/
P33.c
File metadata and controls
35 lines (35 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//PROGRAM TO PRINT TRANSPOSE OF A MATRIX
#include <stdio.h>
void main()
{
static int array[10][10];
int i, j, m, n;
printf("\nEnter the order of the matrix \n");
scanf("%d %d", &m, &n);
printf("\nEnter the elements of the matrix\n");
for (i = 0; i < m; ++i)
{
for (j = 0; j < n; ++j)
{
scanf("%d", &array[i][j]);
}
}
printf("\nThe given matrix is \n");
for (i = 0; i < m; ++i)
{
for (j = 0; j < n; ++j)
{
printf(" %d", array[i][j]);
}
printf("\n");
}
printf("Transpose of matrix is \n");
for (j = 0; j < n; ++j)
{
for (i = 0; i < m; ++i)
{
printf(" %d", array[i][j]);
}
printf("\n");
}
}