What is the output of the following program? #define SQR(x) (x*x) main() { int a,b=3; a= SQR(b+2); printf("%d",a); } a) 25 b) 11 c) error d) garbage value

This question is related to Sonata Interview

Showing Answers 1 - 8 of 8 Answers

Nisha

  • Oct 5th, 2005
 

11

  Was this answer useful?  Yes

manoj

  • Nov 11th, 2006
 

11

  Was this answer useful?  Yes

aditi

  • Jul 19th, 2011
 

11 is correct answer

  Was this answer useful?  Yes

ign407

  • Jul 31st, 2011
 

answer is 11
a= SQR(b+2) is equivalent to writing a=(3+2*3+2) here arthimetic operator * has high preference so
which gives 11. hence, option B is correct.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions