int a = 5; a = a++ + ++a; a = ? (2011)

8 points by chai


invlpg

well... actually two UBs, thanks to which there are three possible correct answers: 11, 12 and 13.

If undefined behaviour is present, then a could have any value after this runs, the program could crash, it could rm -rf your home directory.