Make a program that randomly generates 20 integers in the range of 0 through 999 and fills in an array of 5 x 4 size. Show the matrix, then show the transposed matrix (reverse row with column).
I've already been able to populate the array with random numbers, but I do not know how to transpire.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int i, j, matriz[5][4], matriz5[4][5];
srand(time(NULL));
for (i = 0; i < 5; i++)
for(j = 0; j < 4; j++)
matriz[i][j] = rand()%999;
for (i = 0; i < 5; i++){
for(j = 0; j < 4; j++){
printf(" %d ",matriz[i][j]);
}
printf("\n");
}
return 0;
}