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 :

Click on Discuss to view users comments.

karimulla said: (7:37pm on Wednesday 3rd May 2017)
i think both option A and option C are correct

Write your comments here:



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 :

Click on Discuss to view users comments.

jayashree krishnamoorthy said: (3:10am on Tuesday 13th February 2018)
how 4 will be the var[0][3]

Write your comments here:



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 :

Click on Discuss to view users comments.

Write your comments here:



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 :

Click on Discuss to view users comments.

Write your comments here:



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 :

Click on Discuss to view users comments.

Write your comments here:






*********
X