Array in C++ Array in C++ MCQ Details
MCQ Practice Single Best Answer Topic: Array in C++

Q Which loop is most commonly used to access array elements?

Question ID
#24494
Subchapter
Array in C++
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A while loop
  • B do-while loop
  • C for loop
  • D switch loop
Correct Answer: C

Explanation

The for loop is most commonly used to access array elements because:

  • The number of elements in an array is usually known

  • It allows easy control of the index using initialization, condition, and increment

Example:

for (int i = 0; i < 5; i++) {
    cout << arr[i];
}

Other loops (while, do-while) can also be used, but they are less convenient for array traversal.
A switch loop cannot be used to iterate over arrays.

Correct Answer: C) for loop

Share This Question

Share this MCQ with your friends or study group.