Arrays MCQs Questions Answers – C++
This post covers the important Arrays MCQs type Questions Answers.
- Choose one of the best options. An element Referring outside array bounds is a ___?
A. Logical error
B. Syntax error
C. Execution time error
D. Both A and C
2. Every element in an array is searched against some searching key, special for
A. Linear search
B. Bubble sort
C. All of them
D. Binary search
3. A one-dimensional array contains one-dimensional arrays is called
A. Two-dimensional array
B. Multi-casting array
C. Multi-dimensional array
D. Three-dimensional array
4. Objects in a sequence that have the same type, is called
A. Arrays
B. Operators
C. Functions
D. Stacks
5. A binary search algorithm is an algorithm that is used for
A. Divide and conquer method
B. Linear way to search values
C. Bubble sorting technique
D. None of them
6. With the help of which character array can be initialized using
A. A string literal
B. Integer values
C. Floats value
D. None of them
7. In an array starting from the beginning and inspecting each element one after other for finding an object, until the object is found is called as
A. Linear search algorithm
B. Searching
C. Inspecting
D. All of them
8. Consecutive group of memory locations contains all same name and same type, is called as
A. Structures
B. Arrays
C. Classes
D. Functions
9. For finding value in an array which of the following technique is used?
A. Binary search algorithm
B. Bubble sort
C. Linear search algorithm
D. All of them
10.Programmer’s uses _______ for defining their own types.?
A. Algorithms
B. Operators
C. Enumerations
D. None of them
11.Choose one of the best option from the following Position number contained within a square brackets e.g. my_array [5], is referred as ____?
A. Sub-scripts
B. Post-scripts
C. Elements of an array
D. None of them
12. A one dimensional array is always considered as____?
A. Complex
B. Sequential
C. Linear
D. Both C and B
13.when ______ array that are declared static are initialized
A. The first element is zero
B. Program is about to end
C. Program is loaded into the memory
D. None of them
14. One-dimensional array having two-dimensional arrays is called
A. Two-dimensional array
B. Multi-dimensional array
C. One-dimensional array
D. Three-dimensional array
15. To identify a particular element tables or arrays that require two subscripts are called
A. Multiple subscripted array
B. Double subscripted array
C. Two way array
D. None of them
16. Objects in an array is called as
A. Functions of an array
B. Elements of an array
C. Indexes of an array
D. All of them
17. An array having arrays is called
A. Uni-casting array
B. Multi-dimensional array
C. One-dimensional array
D. Multi-casting array
18. An array can contain how many kinds of elements ?
A. Only int type
B. Only char type
C. Char and int type
D. All of them have same type
19. Example of___ is Float a [3] = {10.2, 33.4, 44.4}
A. Initializing array
B. Initializing variables
C. Initializing functions
D. None of them
20. Array containing elements are numbered as 0,1,2,3? these numbers are called
A. Subscripts of the array
B. Index values
C. Members of an array
D. Both A and B
21. _______ is correctly declares an array?
A. int array;
B. int array[10];
C. array{10};
D. array array[10];
22. Index number of the last element of an array having 9 elements is _______
A. 9
B. Programmer-defined
C. 0
D. 8
23. Array is defined as
A. An array is a series of element
B. An array is a series of elements of the same type in contiguous memory locations
C. An array is a series of elements of the same type placed in non-contiguous memory locations
D. None of the mentioned
24. How we accesses the seventh element stored in array?
A. array[6];
B. array(7);
C. array[7];
D. array;
25. The memory address of the first element in array is _____
A. array[0];
B. array(2);
C. array[1];
D. array;
26. Output of the this program will be _____
#include
using namespace std;
int main ()
{
int array[] = {0, 2, 4, 6, 7, 5, 3};
int n, result = 0;
for (n = 0 ;n < 8 ;n++) {
result += array[n];
}
cout << result;
return 0;
}
A. 25
B. 27
C. 26
D. None of the mentioned
27. Output of this program will be ____?
#include
using namespace std;
int main()
{
int a = 5, b = 10, c = 15;
int arr[3] = {&a, &b, &c};
cout << *arr[*arr[1] – 8];
return 0;
}
A. 18
B. 15
C. garbage value
D. compile time error
28. Output of this program will be ____?
#include
using namespace std;
int main()
{
char str[5] = “ABC”;
cout << str[3];
cout << str;
return 0;
}
A. ABCD
C. ABC
D. None of the mentioned
29. Output of this program will be ____?
#include
using namespace std;
int main()
{
int array[] = {10, 20, 30};
cout << -2[array];
return 0;
}
A. -30
B. -15
C. garbage value
D. compile time error
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