This is C program that ask user to define the Bitwise XOR operator. This operator in C compares each bit of its first operand to the corresponding bit of its second operand. If one bit is 0 and the other bit is 1, the result will bit is set to 1 Otherwise 0.
User declares char type variables for this operation with static value manually. User put method to find out the result c3 = c1 ^ c2. The sign between operands is known as equivalent for bits. And display result on the screen as output.
This is C program that asks user to define the XOR operator in C.
- Declare variables.
- Using method for calculation.
- Display result on the screen.
Here is C source code for defining the XOR operator. Output of this program shown below.
int c1 = 4,c2 = 6,c3 = 0;
c3 = c1 ^ c2;
printf("\n Bitwise XOR i.e. c1 ^ c2 = %d",c3);