Array MCQ : General Questions (Multiple Choice Questions)
Question 1 |
In order to access any element of an array if the position of element is known , Time complexity will be equal to _________.
O(n2) | |
O(n-1) | |
O(n) | |
O(1) |
Question 2 |
Size of an array is known at ________.
Run Time | |
Compile Time |
Question 3 |
A Pointer to a block of memory is considered same as an array.
Yes | |
No |
Question 4 |
What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?
The program may crash if some important data gets overwritten. | |
The array size would appropriately grow. | |
The compiler would report an error. | |
The element will be set to 0. |
Question 5 |
If you pass an array as an argument to a function, what actually gets passed?
First element of the array | |
Base address of the array | |
Value of elements in array | |
Address of the last element of array |
There are 5 questions to complete.