C Programming MCQ

1:

 Consider the following statement.
# define hypotenuse(a, b) sqrt (a * a + b * b ) ;

The macro-call hypotenuse ( a + 2, b + 3) ;

A.

finds the hypotenuse of a triangle with sides a + 2 and b + 3

B.

finds the square root of (a + 2)2 + (b + 3)2

C.

is invalid

D.

finds the square root of 3 * a + 4 * b + 5

 

Answer : D

Explanation :

The macro call will be expanded as
 sqrt(a + 2 * a + 2 + b + 3 * b +3).
i-e, sqrt(3 * a + 4 * b + 5). Hence the answer.

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.