8 Questions
What is an array in C++?
A series of elements of the same type placed in contiguous memory locations
How is an array declared in C++?
type arrayName [ arraySize ];
What is the index of the first element in a C++ array?
0
How is the last element of an array accessed in C++ with n elements?
(n-1)
What is the maximum number of elements that the two dimensional array 'x' can hold?
12 elements
In C++, how do you create a two dimensional array with initial values?
int test = { {2, 4, 5}, {9, 10, 11} };
What happens if you try to access array elements outside of its bound in C++?
The compiler may not show any error
What does the given function in the C++ program do when the contents of the array are passed into it?
It displays all the contents of the array
Test your knowledge on creating and understanding single dimensional arrays, which hold a series of elements of the same type in contiguous memory locations. Learn about how single arrays hold values and their use in storing a collection of data. This quiz is suitable for those studying Module 2 arrays lesson #1.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free