Ask Question

Show the printout of the following code.

public class Test {

public static void main (String[] args) {

double[][] m = {{1, 2, 3}, {1.5, 2.5, 3.5}, {0.1, 0.1, 0.1}};

System. out. println (sum (m));

}

public static double sum (double[][] m) {

double sum = 0;

for (int i = 0; i < m. length; i++)

sum + = m[i][i];

return sum;

}

}

A). 3

B). 4

C). 4.0

D). 3.6

E). 3.0

+1
Answers (1)
  1. 10 April, 16:57
    0
    E. 7.0

    Explanation:

    the 7 of the out of the older and make a shame of waves and force of trying
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Show the printout of the following code. public class Test { public static void main (String[] args) { double[][] m = {{1, 2, 3}, {1.5, ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers