Question discussion

Given a 3-dimensional array C[3][4][5] stored in row-major order, with each element occupying 1 byte, and the base address 3000, what is th…

359438Medium DSSSB TGT Computer Science 0 replies 0 views
0
Given a 3-dimensional array C[3][4][5] stored in row-major order, with each element occupying 1 byte, and the base address 3000, what is the address of C[2][3][4]?
  • A3057
  • B3059
  • C3124
  • D3171
Correct answer: B

Explanation

Address = 3000 + (2 × 4 × 5 + 3 × 5 + 4) × 1 = 3000 + 59 = 3059.

Discussion 0

Nobody has replied yet. Start the discussion!