C++ language › Array in C++ › Question #24490
Single Choice Moderate

QWhich of the following correctly declares an array of 10 integers?

ID: #24490 Array in C++ 44 views
Question Info
#24490Q ID
ModerateDifficulty
Array in C++Topic

Choose the Best Option

Click any option to instantly check if you're correct.

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

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++.

Today: 0 answered · 0 correct
Save progress
Free account

Want to remember what you got wrong?

Create a free account in seconds to track your score, revisit mistakes and continue C++ language where you left off.

  • Save your progress & streak
  • Topic-wise quizzes & scores
  • Bookmark tricky questions
  • Printable MCQ sets
Practice smarterFree account · save progress
Sign up free

Share This Question

Challenge a friend or share with your study group.