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

Q Which of the following correctly declares an array of 10 integers?

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

Choose Your Answer

Click an option to check whether your answer is correct.

  • A int arr;
  • B int arr(10);
  • C int arr[10];
  • D array int arr[10];
Correct Answer: C

Explanation

To declare an array in C++, you must specify:

  • The data type

  • The array name

  • The number of elements inside square brackets [ ]

int arr[10];

This correctly declares an array that can store 10 integers.

Why other options are incorrect

  • A) int arr; ❌ → Declares a single integer, not an array

  • B) int arr(10); ❌ → Not valid array syntax

  • D) array int arr[10]; ❌ → Invalid C++ syntax

Correct Answer: C) int arr[10];

Description:
int arr[10] is the correct way to declare an array of 10 integers in C++.

Share This Question

Share this MCQ with your friends or study group.