In which memory location are the elements of a one-dimensional array generally stored?

Options

  • A. Contiguous memory locations
  • B. Random memory locations
  • C. Only CPU registers
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

A. Contiguous memory locations

Detailed Explanation

Correct Answer: A. Contiguous memory locations

Explanation: Array elements are generally stored in consecutive memory locations.

  • Each element occupies a fixed amount of memory.
  • The address of an element can be calculated using its index.
  • This makes indexed access efficient.