QHow many elements does the array int x[20]; contain?
Question Info
Choose the Best Option
Click any option to instantly check if you're correct.
Explanation
The declaration:
int x[20];
creates an array that can store 20 elements.
-
The number inside the brackets
[20]specifies the total number of elements -
Array indexing starts from 0
-
Valid indices range from 0 to 19
So even though the last index is 19, the array still contains 20 elements.
Correct Answer: C) 20
Description:x[20] means the array size is 20, not 19.
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
Nice — 3 questions done!
Don't lose this streak. Sign up free to save your score and pick up exactly where you stopped.
Share This Question
Challenge a friend or share with your study group.