Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started