kekerice1327 kekerice1327
  • 18-10-2019
  • Computers and Technology
contestada

Consider

int[][] a = {{1,2},{3,4,5}};
int[] b = a[1];
b[0] = 10;

What are the indices i and j of the array element a[i][j] that is equal to 10 after the above code fragment is executed?

Respuesta :

lmcoronadom
lmcoronadom lmcoronadom
  • 18-10-2019

Answer:

i = 1

j = 0

a[1][0] = 10

Explanation:

First define a matrix a that correspond to

 [1,2]

 [3,4,5]

Later the variable b point to the a[1]

 b = [3,4,5]

Later change the value 0 of b

 b = [10,4,5]

The final matrix is

     0     1      2

0  [  1     2 ]

1   [ 10    4    5 ]

And then the 10 value is located in a[1][0]

Answer Link

Otras preguntas

Which of the following equations represents a direct proportional relationship? C A y = 4x Pc y = 2 B y = x -1 0 y=x+23 .x B IN y 1 X -1 D y = x +
how do you solve an equation of 120=6x​
Sean receive $16 each wait for his allowance if he completes all of his chores. He then deposits $4 what is around each week into a savings account. What percen
39. The short-term effects of marijuana can include O A. increased anxiety B. decreased anxiety C. dulled sensory perception D. All of the above
Which of the following situations is an application of the additive inverse property? Choose all that apply. A. A neutrally-charged carbon atom contains 6 posit
What does constant mean in science
Question 2 Multiple Choice Worth 4 points) SS Simplify 5^3 / 5^8 A. 1 / 5^3 B. 5^3 C. 1 / 25 D. 1 / 5-^3
Which amendment was later repealed?
44 thousands ==equals hundreds
Graph the equation for y=5x