Arrays MCQs Questions Answers – C++

12
Score: 0
Attempted: 0/12
1. Which of the following statements is true about multidimensional arrays in C++?



2. How do you declare a 2D array of 3 rows and 4 columns in C++?



3. What is the output of the following code? int arr[3] = {5}; cout << arr[1];



4. Which of the following correctly accesses the last element of an array int arr[10]; ?



5. Which operator is used to get the address of the first element of an array?



6. What happens if you partially initialize an array int arr[5] = {1, 2}; ?



7. Which of the following is a valid way to pass an array to a function in C++?



8. What is the output of the code? int arr[] = {1,2,3}; cout << sizeof(arr);



9. Can an array in C++ be initialized with a for loop during declaration?



10. Which of the following is true about array names in C++?



11. How do you declare a constant array whose elements cannot be modified?



12. Identify the error in the following code snippet:
int arr[5];
arr[5] = 10;
int a b




More Array MCQs

 

Data Structures MCQs

Basic Concepts

  1. Introduction to Data Structures
  2. Complexity Analysis MCQs

Linear Data Structures MCQs

  1. Arrays MCQs
  2. Linked Lists MCQs
  3. Stacks MCQs
  4. Queues MCQs

Non-Linear Data Structures MCQs

  1. Trees MCQs
  2. Heaps MCQs
  3. Graphs MCQs

Hashing MCQs MCQs

  1. Hash Tables

Sorting and Searching Algorithms MCQs 

  1. Sorting Algorithms MCQs
  2. Searching Algorithms MCQs

Miscellaneous

  1. Memory Management in data structures MCQs
  2. String Manipulation Algorithms MCQs
  1. Data Structures MCQs 1
  2. Data Structures MCQs 2
  3. Data Structures MCQs 3
  4. Data Structures MCQs 4
  5. Data Structures MCQs 5
  6. Stacks Solved MCQs
  7. Queues MCQs
  8. pointer mcqs
  9. Array MCQs

 

 

Programming C Plus Plus MCQs Homepage

Low-level and high-level languages MCQs

Procedural and non Procedural languages MCQs

C++ STANDARD LIBRARY MCQs

 Array  MCQs 

Arrays MCQs 2

Pointers Solved MCQs

Inline Function MCQs – C++

Top 50 Programming  C++ MCQs 

MCQs of introduction to programming

Past Papers 2022 C++ MCQs

Past Papers 2021 C++ MCQs

Past Papers 2020 C++ MCQs

Past Papers 2019 C++ MCQs

Highly Recommended C++  Important MCQs with Explanation

OOP

OOP intro & examples MCQs

Classes and Inheritance MCQs

Friend Function MCQs

Virtual Function MCQs

Polymorphism MCQs

Polymorphism MCQs 2

Leave a Reply

Contents Copyrights Reserved By T4Tutorials