i % 2 evaluates as 0 ...
... which translates to boolean false ...
... which means that the result of the ternary expression i % 2 ? 0 : 1 is the latter of the two options, namely 1.
So the switch does case 1: that is, it adds 3 to x, making x become 6.
THEN
it drops through to the next case 2 (because there was no break; in between) ...
... multiplies x by 4 ...
... making x become 24.