Skip to content

Commit 8e9e997

Browse files
authored
Add files via upload
1 parent 729526c commit 8e9e997

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

Transpose of an array.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#include<stdio.h>
2+
main(){
3+
4+
int arr1[2][2];
5+
int arr2[2][2];
6+
int i,j;
7+
printf("enter array elements \n");
8+
for(i=0;i<2;i++)
9+
{
10+
for(j=0;j<2;j++)
11+
{
12+
13+
14+
scanf("%d",&arr1[i][j]);
15+
}}
16+
17+
for(i=0;i<2;i++)
18+
{
19+
20+
for(j=0;j<2;j++)
21+
{
22+
23+
printf("%d",arr1[i][j]);
24+
}
25+
printf("\n");
26+
}
27+
28+
for(i=0;i<2;i++)
29+
{
30+
for(j=0;j<2;j++)
31+
{
32+
arr2[j][i]=arr1[i][j];
33+
}
34+
35+
}
36+
for(i=0;i<2;i++)
37+
{
38+
for(j=0;j<2;j++)
39+
{
40+
printf("%d",arr2[i][j]);
41+
}
42+
printf("\n");
43+
}
44+
45+
}

0 commit comments

Comments
 (0)