ProgrammingModerate

A dynamic array starts with capacity 1 and doubles whenever it is full, until its capacity is at least 10. What is the final capacity?

  1. A. 10
  2. B. 12
  3. C. 8
  4. D. 16

Correct answer: D. 16

The capacities run 1, 2, 4, 8, 16. The first value that reaches 10 or more is 16, after four reallocations.

More C Programming questions

Exams that ask this topic