4
answers
1
watching
88
views

Question 6

Consider the following Java program, which is suppose to compute the transpose of a given 4 x 4 matrix M.

Note: there is an X in the program, which indicates some missing statements.

Choose the correct option to replace X in the program.

#include<java.util.*>
#define ROW 4
#define COL 4
int M[ROW][COL] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
main()
{
int i, j, t;
for (i = 0; i < 4; ++i)
{
X
}
for (i = 0; i < 4; ++i)
for (j = 0; j < 4; ++j)
System.out.println ("%d", M[i][j]);
}

For unlimited access to Homework Help, a Homework+ subscription is required.

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in
Already have an account? Log in

Related questions

Related Documents

Weekly leaderboard

Start filling in the gaps now
Log in