forked from anxkhn/CP-SAMPLE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path18.c
38 lines (35 loc) · 689 Bytes
/
18.c
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
36
37
38
#include<stdio.h>
#include<stdio.h>
void main()
{
int i,j,r;
int a[100][100];
printf("Enter the no of rows for square matrix(columns will be same):");
scanf("%d",&r);
for(i=0;i<r;i++)
{
for(j=0;j<r;j++)
{
printf("enter the element:");
scanf("%d",&a[i][j]);
}
}
printf("\nmatrix A is\n");
for(i=0;i<r;i++)
{
for(j=0;j<r;j++)
{
printf("%d\t",a[i][j]);
}
printf("\n");
}
printf("\nmatrix A after transpose\n");
for(i=0;i<r;i++)
{
for(j=0;j<r;j++)
{
printf("%d\t",a[j][i]);
}
printf("\n");
}
}