Multiple choice

The following statements find the

define hypotenuse(a, b) sqrt( a*a + b*b);

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

  1. hypotenuse of a triangle with sides, a+2 and b+3.

  2. the square root of 3*a + 4*b + 5

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

  4. none of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Macros perform simple text substitution. Replacing a and b with (a+2) and (b+3) in sqrt(a*a + b*b) yields sqrt((a+2)(a+2) + (b+3)(b+3)). The provided option B is a literal expansion of the macro without the intended mathematical grouping.