BITWISE OPERATORS

Used to perform operations on individual bits of integer operands.

 

int a = 5, b = 3;

printf("%d\n", a & b);  // Bitwise AND

printf("%d\n", a | b);  // Bitwise OR

printf("%d\n", a ^ b);  // Bitwise XOR

printf("%d\n", ~a);      // Bitwise NOT (one's complement)