Arrays MCQs Questions Answers – C++

Arrays MCQs Questions Answers – C++

This post covers the important Arrays MCQs type Questions Answers.

  1. 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

Answer - Click Here:
D

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

Answer - Click Here:
A

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

Answer - Click Here:
A

4. Objects in a sequence that have the same type, is called

A. Arrays
B. Operators
C. Functions
D. Stacks

Answer - Click Here:
A

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

Answer - Click Here:
A

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

Answer - Click Here:
A

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

Answer - Click Here:
A

8. Consecutive group of memory locations contains all same name and same type, is called as

A. Structures
B. Arrays
C. Classes
D. Functions

Answer - Click Here:
B

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

Answer - Click Here:
D

10.Programmer’s uses _______ for defining their own types.?

A. Algorithms
B. Operators
C. Enumerations
D. None of them

Answer - Click Here:
C

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

Answer - Click Here:
A

12. A one dimensional array is always considered as____?

A. Complex
B. Sequential
C. Linear
D. Both C and B

Answer - Click Here:
D

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

Answer - Click Here:
C

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

Answer - Click Here:
C

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

Answer - Click Here:
B

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

Answer - Click Here:
B

17. An array having arrays is called

A. Uni-casting array
B. Multi-dimensional array
C. One-dimensional array
D. Multi-casting array

Answer - Click Here:
B

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

Answer - Click Here:
D

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

Answer - Click Here:
A

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

Answer - Click Here:
D

21. _______ is correctly declares an array?
A. int array;
B. int array[10];
C. array{10};
D. array array[10];

Answer - Click Here:
B

22. Index number of the last element of an array having 9 elements is _______
A. 9
B. Programmer-defined
C. 0
D. 8

Answer - Click Here:
D

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

Answer - Click Here:
B

24. How we accesses the seventh element stored in array?
A. array[6];
B. array(7);
C. array[7];
D. array;

Answer - Click Here:
A

25. The memory address of the first element in array is _____
A. array[0];
B. array(2);
C. array[1];
D. array;

Answer - Click Here:
D

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

Answer - Click Here:
B

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

Answer - Click Here:
D

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
B. AB
C. ABC
D. None of the mentioned

Answer - Click Here:
C

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

Answer - Click Here:
A

Computer Science Repeated MCQs Book Download

Latest posts by Prof. Fazal Rehman Shamil (see all)