πŸ“Š C Programming
Q. What will be the output of the following code?
Code:
#include <stdio.h>
int main() {
    int a = 5;
    printf("%d %d", a++, ++a);
    return 0;
}
  • (A) 5 6
  • (B) 6 6
  • (C) 6 7
  • (D) Undefined behavior
πŸ’¬ Discuss
βœ… Correct Answer: (D) Undefined behavior

Explanation: Modifying and accessing a variable more than once without sequence point results in undefined behavior.

Explanation by: Mr. Dubey
Modifying and accessing a variable more than once without sequence point results in undefined behavior.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
48
Total Visits
πŸ“½οΈ
9 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
82%
Success Rate