Classical

C Programming MCQ - Arrays

21:  

The parameter passing mechanism for an array is

A.

call by value

B.

call by value-result

C.

call by reference

D.

none of these

 
 

Option: C

Explanation :


22:  

 Consider the statement

int val[2] [4] = { 1, 2, 3, 4, 5, 6, 7, 8} ;

4 will be the value of

A.

val[0 ][ 3]

B.

val[0][4]

C.

val[1][1]

D.

none of the above

 
 

Option: A

Explanation :


23:  

The maximum number of dimension an array can have in C is

A.

3

B.

4

C.

5

D.

compiler dependent

 
 

Option: D

Explanation :


24:  

Under which of the following conditions, the size of an one-dimensional array need not be specified?

A.

when initialization is a part of definition

B.

when it is a declaration

C.

when it is a formal parameter and an actual argument

D.

All of the above

 
 

Option: D

Explanation :


25:  

If a two dimensional array is used as a formal parameter, then

A.

both the subscripts may be left empty

B.

the first (row) subscript may be left empty

C.

the first subscript must be left empty

D.

both the subscripts must be left empty

 
 

Option: B

Explanation :




Suggest an improvement