Chapter 2 : Arrays : Objective Questions

Chapter 2 : Arrays

Multiple Choice Questions

 

1.Collection of elements of the same type placed in contiguous memory locations.

a) Variable

b) Array

c) Loop

d) Function

 

2. Array index starts with the value

a) One

b) Null Character

c) Zero

d) None of These


3. The memory space allocated for an array can be computed using

a) total_bytes = sizeof (array_type) / size_of_array

b) total_bytes = sizeof (array_type) + size_of_array

c)  total_bytes = sizeof (array_type) - size_of_array

d) total_bytes = sizeof (array_type) x size_of_array


4.Accessing each element of an array at least once to perform any operation is known as 

a) Navigation

b) Traversal

c) Indexing

d) Looping


5.  Which character is stored at the end of the string

a)  '\0'

b) '\n'

c) '\t'

d) '/0'

6. A console output function used in C++ to display a string data on
the standard output device (monitor).

a) getline()

b) printf ()

c) getchar()

d) puts()


7. An array element is accessed using 

a) Array name only

b) Subscript only

c) Array name and Subscript

d)None of these

 

8. Consider the array declaration int a[]={1,2,4}; What is the value of a[1] ?

a) 2

b) 1

c) 4

d) 0

9. int n[ ] = { 2,3,15,8,48,13 }; Here What is the size of the array n

a) 5

b) 6

c) 7

d) None of these

10 . Consider the array declaration int a[3]={2,3,4}; What is the value of a[0] ?

a) 4

b) 3

c) 2

d) 0

 

 

 


Comments