A one-dimensional array A has indices 1 through 75. Each element is a string…
2009
A one-dimensional array A has indices 1 through 75. Each element is a string that occupies three memory words. The base address of the array is decimal location 1120. What is the starting address of A[49]?
Answer: C. 1264 — ConceptFor a one-dimensional array with lower bound L and element width w, the address of A[i] is found by adding the storage occupied by the preceding…
- A.
1267
- B.
1164
- C.
1264
- D.
1169
Attempted by 796 students.
Show answer & explanation
Correct answer: C
Concept
For a one-dimensional array with lower bound L and element width w, the address of A[i] is found by adding the storage occupied by the preceding elements to the base address.
Therefore, Address(A[i]) = Base + (i − L) × w. The subtraction counts how many complete elements come before A[i].
Application
Identify the values: Base = 1120, i = 49, L = 1, and w = 3 memory words.
Count the preceding elements: i − L = 49 − 1 = 48.
Find their storage: 48 × 3 = 144 memory words.
Add the offset to the base: 1120 + 144 = 1264.
Cross-check
A[1] starts at 1120. Moving forward by 48 elements, with 3 words per element, advances the address by 144, so A[49] starts at 1264.
Explore the full course: Iocl Engineers Officers Grade A Paper 2