Home /
Expert Answers /
Computer Science /
write-a-program-that-reads-12-integers-into-a-2d-integer-array-with-4-rows-and-3-columns-the-prog-pa482
(Solved):
Write a program that reads 12 integers into a 2D integer array with 4 rows and 3 columns. The prog ...
Write a program that reads 12 integers into a 2D integer array with 4 rows and 3 columns. The program then outputs the transpose of the \( 2 \mathrm{D} \) array - where the rows become columns and the columns become rows. Ex: If the input is: \[ \begin{array}{lll} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ 7 & 7 & 7 \end{array} \] then the output is: \[ \begin{array}{llll} 1 & 4 & 7 & 7 \\ 2 & 5 & 8 & 7 \\ 3 & 6 & 9 & 7 \end{array} \] For coding simplicity, output a space after every integer, including the last one on each row.