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 shows the equation 6^2=35 in logarithmic form
The human body works constantly to maintain a stable, internal environment. This environment is called... (a) equilibrium (b)fitness (c)health (d)homeostasis
Which emits visible light A. Moon B. Planet C. Satellite D. Star
What is the fate of certain vitamins and minerals¾such as vitamin c, thiamin, and sodium¾when they are consumed in excess?
What is the main goal of developing bamboo as a commodity in East Asia? A) Selling bamboo globally. B) Providing a cash based income for local citizens. C) To
Structural damage from seismic vibrations would be worse ________.
A sidewalk of width 2 feet is being built around a pool. Which expression represents the area of the sidewalk?
Holly messed eight of 180 school days this year approximately what percent of school days with Holly and attendance
The minute hand of a clock is 3 inches long. how far does the tip of the minute hand move in 25 minutes
Why does claudius plan to poison the drink?