Mega Code Archive

 
Categories / C Tutorial / Operator
 

Bitwise XOR

# include<stdio.h> main() {   char c1 = 4,c2 = 6,c3 = 3;   c3 = c1 ^ c2;   printf("\n Bitwise XOR i.e. c1 ^ c2 = %c",c3); } Suppose c1 = 4, c2 = 6; The value of c1 ^ c2 is interpreted as follows: 0000 0100   ^ 0000 0110     ----------     0000 0010