Home » Technical Questions » Programming

What would be the output of the following program? # define SQR(x) (x * x) main() { int a, b = 3; a = SQR ( b + 2 ); Printf ("\n %d ", a ); }

Correct Answer: 11 Because, on preprocessing the expression becomes a = ( 3 + 2 * 2 + 3), as Ist preference is multiply & then addition, it evalvates as(3+ 2 * 3 +2) = (3+6+2)=11

← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion