The semantics of expressions containing unsequenced side effects on a particular variable are undefined in C, per §6.5 ¶2 of the C11 standard (albeit the working draft is all I am privy to). As the two possible executions of the expression on line 7 are not confluent, the best answer is B.
After writing this code, compiling it, then running it, I can tell you with certainty that it prints 11 and 22. D.
ReplyDeletethat is correct. Did you try to guess the output without running it?
DeleteCompile time Error, need to declare function prototype
ReplyDeleteIt does not give an error
DeleteThe semantics of expressions containing unsequenced side effects on a particular variable are undefined in C, per §6.5 ¶2 of the C11 standard (albeit the working draft is all I am privy to). As the two possible executions of the expression on line 7 are not confluent, the best answer is B.
ReplyDelete