Skip to content

Commit 89d58b0

Browse files
Create 13Transposematrix.cpp
1 parent e895599 commit 89d58b0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

13Transposematrix.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Online C++ compiler to run C++ program online
2+
#include <bits/stdc++.h>
3+
using namespace std;
4+
int main() {
5+
int n;
6+
int m;
7+
cin>>n>>m;
8+
int arr[n][m];
9+
for(int i=0;i<n;i++){
10+
for(int j=0;j<m;j++){
11+
cin>>arr[i][j];
12+
}
13+
}
14+
15+
for(int i=0;i<n;i++){
16+
for(int j=0;j<m;j++){
17+
cout<<arr[j][i];
18+
cout<<" ";
19+
}cout<<endl;
20+
}
21+
22+
return 0;
23+
}

0 commit comments

Comments
 (0)