To set the fourth bit, OR
with 00001000
(binary).
To clear the fourth bit, AND
with 11110111
(binary).
To toggle the fourth bit, XOR
with 00001000
(binary).
Examples:
00110010 OR 00001000 = 00111010
00110010 AND 11110111 = 00110010
00110010 XOR 00001000 = 00111010