C++ Array Solved MCQs Questions Answers

9
Score: 0
Attempted: 0/9
1. What is the index of the first element in a C++ array?



2. Which of the following correctly declares an array of 10 integers in C++?



3. What happens if you try to access an array element out of its bounds in C++?



4. How many elements are there in the array int nums[5] = {10, 20, 30};?



5. Which of the following statements about C++ arrays is true?



6. What will be the output of the following code?int arr[] = {1, 2, 3, 4};cout << arr[2];



7. Which of the following correctly finds the number of elements in a statically declared array arr?



8. What is the correct way to initialize all elements of an array to zero?



9. What is the output of the following code snippet?
int arr[3] = {10, 20, 30};
cout << *(arr + 1);




More Array MCQs

Programming C Plus Plus MCQs Homepage

Leave a Reply

Contents Copyrights Reserved By T4Tutorials