Which pair of load and modify statement should be inserted in the code?

Given the code fragment: Which pair of load and modify statement should be inserted in the
code? The load statement should set the array’s x row and y column value to the sum of x
and y The modify statement should modify the array’s x row and y column value by
multiplying it by 2

Given the code fragment: Which pair of load and modify statement should be inserted in the
code? The load statement should set the array’s x row and y column value to the sum of x
and y The modify statement should modify the array’s x row and y column value by
multiplying it by 2

A.
Load statement: array2d(x,y) = x + y; Modify statement: array2d(x,y) = array2d(x,y) * 2

B.
Load statement: array2d[x y] = x + y; Modify statement: array2d[x y] = array2d[x y] * 2

C.
Load statement: array2d[x,y] = x + y; Modify statement: array2d[x,y] = array2d[x,y] * 2

D.
Load statement: array2d[x][y] = x + y; Modify statement: array2d[x][y] = array2d[x][y] * 2

E.
Load statement: array2d[[x][y]] = x + y; Modify statement: array2d[[x][y]] = array2d[[x][y]] *
2



Leave a Reply 2

Your email address will not be published. Required fields are marked *


imyrta

imyrta

Answer: D

Explanation:

The syntax for accessing array values is wrong in all the other options.