Emily is working with bitwise operations and wants to set a specific bit of an integer variable to 1. Which operator would help her achieve this?
- AND
- Bitwise Shift
- OR
- XOR
Emily should use the XOR (^) operator to set a specific bit of an integer variable to 1. XOR toggles the bit's value without affecting other bits.
Loading...