Q. What will the following code print?

Code:
int a = 5;
printf("%d %d", a++, ++a);
  • (A) 5 6
  • (B) 6 6
  • (C) Undefined behavior
  • (D) 6 7
πŸ’¬ Discuss
βœ… Correct Answer: (C) Undefined behavior
Explanation: Modifying a variable more than once in the same statement causes undefined behavior.
Explanation by: Mr. Dubey
Modifying a variable more than once in the same statement causes undefined behavior.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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