Classical

C Programming MCQ - Functions & Recursion

11:   The function is lower(char) checks whether a character is in lower case or not, therefore it should return
A. 0 or 1
B. -1,0 or 1
C. a character
D. nothing
 
 

Option: A

Explanation :

Click on Discuss to view users comments.

Write your comments here:



12:   If max is a function that returns the larger of the two integers, given as arguments, then which of the following statements finds the largest of three given numbers
A. max(max(a,b),max (a,c))
B. max(max(a,b),max (b,c))
C. max(b,max (a,c))
D. All of these
 
 

Option: D

Explanation :

Click on Discuss to view users comments.

Write your comments here:



13:   A function can make
A. One throw
B. One throw of each scale type
C. One throw of each programmerdefined type
D. As many throws of as many types as necessary
 
 

Option: D

Explanation :

Click on Discuss to view users comments.

Write your comments here:



14:  

Consider the function

find ( int x, int y)
{
return (( x < y ) ? 0 : ( x - y ));
}


Let a, b be two non-negative integers.
The call find{ a, find(a, b)} can be used to find the

A.

maximum of a, b

B.

positive difference of a, b

C.

sum of a, b

D.

minimum of a, b

 
 

Option: D

Explanation :

Click on Discuss to view users comments.

Write your comments here:



15:  

 Let a, b be two non-negative integers. Which of the following calls, finds the positive difference of a and b ?

A.

find(a, b) + find (b, a)

B.

find (a, find(a, b))

C.

a + find (a, b)

D.

b + find(a, b)

 
 

Option: A

Explanation :

Click on Discuss to view users comments.

Write your comments here:





Suggest an improvement