If you’re learning C++ or preparing for an exam, practicing C++ Array MCQs can be a great way to test your understanding. Arrays are one of the most fundamental concepts in programming, helping you store and manage multiple values efficiently. Whether you’re dealing with single-dimensional or multi-dimensional arrays, knowing how to declare, initialize, and manipulate them is crucial. These MCQs cover everything from basic syntax to advanced operations, making them a useful tool for both beginners and experienced programmers. By going through these questions, you’ll not only strengthen your knowledge but also gain confidence in handling arrays effectively.
C++ Array Important MCQs
- _________ is a group of consecutive memory locations with same name and data type.
(a) Loop
(b) Array
(c) Function
(d) Class and Object
(b) Array
- Each element of an array has its own.
(a) Name
(b) Index
(c) Size of an Array
(d) List of Number
(b) Index
- The index of the first element of an array is aloways;
(a) 0
(b) 1
(c) -1
(d) All of these
(a) 0
- Each Element in array has
(a) Name
(b) Unique Index
(c) Size of an Array
(d) List of Number
(b) Unique Index
- Which of the following correct declaration of an array?
(a) int array[10];
(b) int array[10];
(c) int array{10};
(d) INT array[10];
(b) int array[10];
- Object of an array is called as ____________.
(a) Element of an Array
(b) Index of an Array
(c) Size of an array
(d) List of an Array
(a) Element of an Array
- What is the index number of the last element of an array with 50 elements?
(a) 50
(b) 49
(c) 51
(d) None of these
(b) 49
- What is the index number of the first element of an array with 50 elements?
(a) 0
(b) 1
(c) -1
(d) 30
(a) 0
- Which of the following is correct initialization of array?
(a) int arr[2][2] = [1,2,34],[11,22,44],[41,23,24];
(b) int arr[2][2] = {1,2,34};{11,22,44};{41,23,24};
(c) int arr[2][2] = {1,2,34},{11,22,44},{41,23,24};
(d) int arr[2][2] = {1,2,34},{11,22,44},{41,23,24};
(d) int arr[2][2] = {1,2,34},{11,22,44},{41,23,24};
- In the declaration statement
int arr[10][6];
the total number of element is?
(a) 61
(b) 60
(c) 16
(d) None of these
(b) 60
- Which of the following functions is used to return the length of a string?
(a) strlen
(b) stringsize
(c) stringlen
(d) None of these
(a) strlen
- Which of the following function is used to copy one string to another string?
(a) strcopy
(b) stringcopy
(c) stringcpy
(d) strcpy
(d) strcpy
- A character constant is written in _______.
(a) Double Quotes
(b) Single Quotes
(c) Quote
(d) None of these
(b) Single Quotes
- What is the output of the following code?
float arr[3] = {5500,3000,202,5605};
cout<<[1];
(a) 5500
(b) 3000
(c) 8500
(d) None of these
(b) 3000
- Which of the following functions is used to append a string on to the end of another string?
(a) strcmp
(b) strlen()
(c) stringcpy
(d) strcat()
(d) strcat()
- Which of the following functions is used to compare two string character by character?
(a) strcmp
(b) stringcompare
(c) strlen
(d) None of these
(a) strcmp
- The
strcmp()
function will return ________ if string 1 is greater than string 2?
(a) 0
(b) Null
(c) 1
(d) -1
(c) 1
- Which of the following function is used to read a string from a keyboard that may contain blank space?
(a) cin.gets()
(b) cin.get()
(c) cin.puts()
(d) None of these
(b) cin.get()
- The
strcmp()
function will return _______ if string 1 is less than string 2?
(a) 0
(b) Null
(c) 1
(d) -1
(d) -1
- All strings end with special character called __________ character.
(a) Null
(b) Zero
(c) 1
(d) None of these
(a) Null
- The
strcmp
function will return _______ if string 1 and string 2 are same.
(a) 0
(b) Null
(c) 1
(d) -1
(a) 0
- A string constant is written in ______.
(a) Single Quotes
(b) Double Quotes
(c) Without Quotes
(d) None of these
(b) Double Quotes
- A two dimensional array is always considered as
(a) Linear
(b) Sequential
(c) Matrix
(d) All of these
(c) Matrix
- Which of the following provides the number of bytes occupied by the data type given in the parenthesis?
(a) pow()
(b) sizeof()
(c) strcmp
(d) None of these
(b) sizeof()
- What is output the following code segment?
int Array[5] = {10,20,30,40,60,56};
cout<<Array[2];
(a) 20
(b) 10
(c) 30
(d) All of these
(c) 30
- Array is used for :
(a) Array can store a large number of values with single name.
(b) The use of arrays reduces Program Size.
(c) A Search Process can be applied an array easily.
(d) All of these
(d) All of these
- A One Dimensional Array is always considered as
(a) Linear
(b) List
(c) Linear/List
(d) All of these
(c) Linear/List
- One Dimensional Array contains __________ row and _______________ column?
(a) Single Row and Multiple Columns
(b) 1 row and 2 columns
(c) Single Row and one Columns
(d) None of these
(a) Single Row and Multiple Columns
- Two dimensional Array is always considered as
(a) Table
(b) Matrix
(c) Table/Matix
(d) All of these
(c) Table/Matix
- Two dimensional Array contains __________ row and ________ columns?
(a) Multiple Row and Multiple Columns
(b) 1 Row and 2 Columns
(c) Single Row and Multiple Columns
(d) None of these
(a) Multiple Row and Multiple Columns
- Correct Syntax of One Dimensional Array is ____________.
(a) Datatype arrayname[arraysize];
(b) Datatype arrayname[arraysize];
(c) Datatype arrayname{arraysize};
(d) All of these
(b) Datatype arrayname[arraysize];
- Correct Syntax of two dimensional Array is __________.
(a) Datatype arrayname[arraysize];
(b) .datatype arrayname[columnsize][rowsize];
(c) datatype arrayname[rowsize][columnsize];
(d) All of these
(c) datatype arrayname[rowsize][columnsize];
- How many kinds of elements an array can have?
(a) Char and int type
(b) Only char type
(c) Only int type
(d) All of them have same type
(d) All of them have same type
- what does the following code do?
for (int index = 0; index < 5; index++){
cin >> numbers[index];
}
(a) Place data into a four element array called numbers.
(b) Place data into a four element array called index.
(c) Place data into a five element array called numbers.
(d) Place data into a five element array called index.
(d) Place data into a five element array called index.
- what is the last legal subscript that can be used with the following array?
Int Values[5];
(a) 4
(b) 0
(c) 6
(d) 5
(a) 4
- every element in an array is searched against some searching key, special for
(a) Linear search
(b) Bubble sort
(c) Binary search
(d) All of them
(a) Linear search
- which of the header file is used for array type manipulation?
(a) <array>
(b) <type_traits>
(c) <iostream>
(d) std namespace
(d) std namespace
- What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout<<rank<int[10]>::value;
cout<<rank<char[10][10]>::value;
cout<<rank<string[10][10][10]>::value;
return 0;
}
(a) 400
(b) 123
(c) 111
(d) 200
(b) 123
- Array is a ________ collection of similar data items, by similar we mean that all data items must have the same type
(a) finite
(b) undefined
(c) 3 time
(d) Both a and b
(a) finite
- Array variable can store __________.
(a) More then one value
(b) store string,integer values
(c) Both a and b
(d) None
(a) More then one value
- An array can be a Single Dimensional _________________.
(a) one Subcript Dealing with one Dimensional
(b) two Subcript
(c) three Subcript
(d) None
(a) one Subcript Dealing with one Dimensional
- Array Subcript Start with index no ___.
(a) 1
(b) 2
(c) 3
(d) 0
(d) 0
- The two dimensional (2D) array in C programming is ___________.
(a) matrix
(b) subcript
(c) index
(d) no
(a) matrix
- In Single Dimensional Array ________ is used
(a) single Subcript
(b) multiple Subcript
(c) three Subcript
(d) two Subcript
(a) single Subcript
- In two dimensional array the first subcript of array is ________.
(a) Row
(b) Column
(c) Both a and b
(d) Nobe
(a) Row
- In two dimensional array the second subcript/index of the array is __________.
(a) Row
(b) Column
(c) Both a and b
(d) Nobe
(b) Column
Conclusion
Mastering C++ arrays isn’t just about memorizing syntax—it’s about understanding how to use them in real-world scenarios. Practicing C++ Array MCQs can help you spot common mistakes, improve your problem-solving skills, and prepare for coding interviews or exams. The more you practice, the better you’ll get at writing efficient and optimized code. Arrays are the building blocks for many advanced data structures, so having a strong foundation will make it easier to tackle more complex programming challenges down the line. Keep practicing, stay curious, and you’ll see your coding skills improve over time.