Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

College Algebra

Authors: Margaret L. Lial, John Hornsby, David I. Schneider, Callie Daniels

12th edition

134697022, 9780134313795 , 978-0134697024

More Books

Students also viewed these Mathematics questions

Question

1. Explain how the decision to conduct marketing research is made.

Answered: 1 week ago