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 hypotenuse of triangle with sides a + 2 and b+3
B. finds square root of (a + 2)2 + (b + 3)2
C. is meaningless
D. finds square root of 3*a + 4*b + 5
 

Answer : D

Explanation :

MAYANK said: (3:22pm on Wednesday 8th May 2013)
he macro will simply be replaced anywhEre they are called(no concept of brackets or parenthesis).thus in hypotenuse(a 2,b 3)a*a b*b = a 2*a 2 b 3*b 3= a 2a b 3b 5= 3a 4b 5

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.