Classical

C Programming MCQ - Functions & Recursion

16:  

The default parameter passing mechanism is

A.

call by value

B.

call by reference

C.

call by value result

D.

none of above

 
 

Option: A

Explanation :

Which means a function will be manipulating a copy of the local variable, passed as argument. So. any change will be local and hence will not he reflected in the calling routine.


17:  

Use of functions

A.

helps to avoid repeating a set of statements many times

B.

enhances the logical clarity of the program

C.

helps to avoid repeated prograniming across programs

D.

all of the above

 
 

Option: D

Explanation :


18:  

 Pick the correct statements

A.

The body of a function should have only one return statement

B.

The body of a function may have many return statements

C.

A function can return only one value to the calling environment

D.

Both (b) & (c)

 
 

Option: D

Explanation :


19:  

max is a function that returns the larger of the two integers, given as arguments. Which of the following statements finds the largest of three given numbers?

A.

max (max (a, b), max (a, c))

B.

max(b, max(a, c) )

C.

max (max (a, b). max ( b, c ))

D.

All of the above

 
 

Option: D

Explanation :


20:  

Forward declaration is absolutely necessary

A.

if a function returns a non-integer quantity

B.

lithe function call precedes its definition

C.

if the function call precedes its definition and the function returns a non integer quantity

D.

none of the above

 
 

Option: C

Explanation :




Suggest an improvement