I recently learnt about undefined behaviour in C, but this particular code was used in a site as an example for \'comma as an operator\', and while I understand how y = x++
It is not undefined behaviour.
You first increase x to 11, the print it, then increase it to 12 and print it, then increase it after evaluation, so x will be 13 and the whole expression will evaluate to 12.
This is caused due to the comma operator in C being a sequence point, which means it is guaranteed all side effects of previous evaluations will have been performed, and no side effect from subsequent evaluations have yet been performed.