Q. What is the output of the following?

Code:
#define SQUARE(x) x*x
printf("%d", SQUARE(3+1));
  • (A) 16
  • (B) 7
  • (C) 13
  • (D) Compiler Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 7
Explanation: Macro expands to 3+1*3+1 = 3+3+1 = 7 due to lack of parentheses.
Explanation by: Mr. Dubey
Macro expands to 3+1*3+1 = 3+3+1 = 7 due to lack of parentheses.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
67
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
95%
Success Rate