Compound operators in Arduino work just like in C, and they help save you some writing time, and also reduce the number of lines in your code. As the name seems to suggest, compound operators combine multiple operators.
The following table lists the compound operators in Arduino.
Assume that a and b are integers having values a = 5 and b = 2 in all the following examples −
|&=||Compound bitwise AND||a&=b||a=0|
||=||Compound bitwise OR||a|=b||a=7|
|^=||Compound bitwise XOR||a^=b||a=7|