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;
}
β
Correct Answer: (D)
Undefined behavior
Explanation: Modifying and accessing a variable more than once without sequence point results in undefined behavior.