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

could some one help me please / whats the answer for 4+3p= 19
how do you solve x+2/3=11//12
How is the behavior of waves affected by a medium?
Evaluate log (base 9) 27. Can someone explain this one for me so i could do some tasks on my own?
Jessica is making 2 loaves of banana bread. She needs 3/4 cup of sugar for each loaf. Her measuring cup can only hold 1/4 cup of sugar. How many times will Jess
find all critical values of the function g(x)=5/(x²-x+6)
Yoshi and Rana serve muffins. There are 3 muffins with nuts. 1/6 of the muffins have nuts. How many muffins do they serve in all?
Some processes that occur in a cell are listed below.A. utilize energyB. detect changes in the environmentC. rearrange and synthesize chemical compoundsWhich pr
the  expression lod3 (8-x) is defined for all values of x such as
Jessica is making 2 loaves of banana bread. She needs 3/4 cup of sugar for each loaf. Her measuring cup can only hold 1/4 cup of sugar. How many times will Jess