Question: 13.) private int[][] squareMat = {{3,1,7}, {8,7,3}, {6,4,2}}; public void fun(){ for(int r = 0; r < squareMat.length / 2; r++) for(int c = 0;

13.)

private int[][] squareMat = {{3,1,7},

{8,7,3},

{6,4,2}};

public void fun(){

for(int r = 0; r < squareMat.length / 2; r++)

for(int c = 0; c <= r; c++)

squareMat[r][c] = squareMat[c][r];

}

////////////////////////////////////////////////////////////////////////////////////////////////

//test code in another method of the same class

fun();

out.println(squareMat[2][2]);

a.) 2

b.) 7

c.) 6

d.) 8

e.) 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!