Which statement correctly initializes an integer array with three elements in C++?

Options

  • A. int a[3] = {10, 20, 30};
  • B. int a = {10, 20, 30};
  • C. array int a[3] = {10, 20, 30};
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

A. int a[3] = {10, 20, 30};

Detailed Explanation

Correct Answer: Option A

Explanation: int a[3] = {10, 20, 30}; declares an integer array of three elements and initializes them with 10, 20, and 30.