Simple, since you have, or whatever value you have,
int x = 50;
To set 4th bit (from right) programatically,
int y = x | 0x00000008;
Because, 0x
prefixed before a number means it's hexadecimal form.
So, 0x0 = 0000
in binary, and 0x8=1000
in binary form.
That explains the answer.