Multiple choice

The memory address of fifth elements of an array can be calculated by the formula

  1. LOC(Array[5]=Base(Array)+w(5-lower bound), where w is the number of words per memory cell for the array

  2. LOC (Array[5]=Base(Array[5])+(5-lower bound), where w is the number of words per memory cell for the array

  3. LOC(Array[5]=Base(Array[4])+(5-Upper bound), where w is the number of words per memory cell for the array

  4. LOC (Array[5]=Base(Array)+w(5-Upper bound), where w is the number of words per memory cell for the array

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The formula for calculating memory address uses: Base Address + (Index - Lower_Bound) × Word_Size. Option A correctly shows this pattern (despite minor notation issues). Options B and C incorrectly index into the array rather than using the base address. Option D uses Upper bound instead of Lower bound in the offset calculation, which is incorrect.