1. Home
  2. Computer Science MCQs
  3. C Programming
  4. With #define SQUARE(x) x*x, what does SQUARE(2 + 3)…

Added 30 Nov -0001

With #define SQUARE(x) x*x, what does SQUARE(2 + 3) evaluate to?

  1. 13
  2. 10
  3. 11 Correct answer
  4. 25

Correct answer

C. 11

12 views

MCQSEXAM

Explanation

The macro expands to 2 + 3 * 2 + 3 without parentheses, so operator precedence makes the result 11.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C Programming MCQs

Practise all C Programming MCQs

Similar MCQs