#include
#include
using namespace std;
int main(){
srand(time(NULL));
int **arr, N, M;
cout << "N : ";<br> cin >> N;
cout << "M : ";<br> cin >> M;
arr = new int *[N];
for(int i = 0; i < M ; i++)
arr[i] = new int [M];
for(int i = 0; i < N ; i++)
for(int j = 0; j < M ; j++)
arr[i][j] = rand() % 150;
cout << "your array : " << endl;<br> for(int i = 0; i < N ; i++){
for(int j = 0; j < M ; j++)
cout << arr[i][j] << "\t";<br> cout << endl;<br> }
cout << "your NEW array : " << endl;<br> for(int i = 0; i < N ; i++){
for(int j = 0; j < M ; j++)
cout << arr[j][i] << "\t";<br> cout << endl;<br> }
cout << endl;<br>}