CP CVDT Q15

  • Option : D
  • Explanation : The macro parameters are not enclosed in parentheses, so macro substitution produces sqrt(a+2*a+2 + b+3*b+3). By operator precedence, multiplication is evaluated before addition. The expression simplifies to sqrt(3*a + 4*b + 5). Therefore, option D is correct. A safer macro would parenthesize each parameter occurrence.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *