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

Determine which ordered pair is a solution of y=8x. A. (0,8) B. (-1,8) C. (1.5,10) D. (2,16)
How many hundreds are in this number 128
what special adaptation do strawberry plant stems have
"A cube measures 6.6 inches on each side. Find the area of one face of the cube.
102 over 250 as a decimal
Which of these men helped free the most territories from Spain? - Simon bolivar - Miquel hidalgo - Jose de San Martin - Ernesto lecuona
Claims that media consumption can be addictive are: A. controversial. B. never made. C. absolutely true. D. unfounded.
emelia's basketball team won their game. Everyone gave everyone else on the team (5playes in total) a single high five. How many high fives were exchanged?
es una palabra que sirbe para identificar las caracteristicas de personas lugares o cosas
The supremacy clause of the U.S. Constitution has supported the (4 points) national government's sovereignty over matters related to citizen health care and edu