The assignment of a bit can only be 1 or 0.
Let's get started:
1. Assign the third bit of A to 1.
a | =(0x 0 1 & lt; & lt3); //a or equal to 1 shifts 3 bits to the left, ensuring that other bits remain unchanged, and bit3 is assigned to 1.
2. clear biit3 of a.
a & amp= ~(0x 0 1 & lt; & lt3); //a is equal to (1 inverted after shifting 3 bits to the left), thus ensuring that other bits remain unchanged and bit 3 is cleared.
I hope I can help you!