Turn Desktop View Off
by Dinesh Thakur

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.

Problem Statement:

This is C program that asks user to define the XOR operator in C.

  1. Declare variables.
  2. Using method for calculation.
  3. Display result on the screen.

Here is C source code for defining the XOR operator. Output of this program shown below.

# include<stdio.h>
void main()
{
  int c1 = 4,c2 = 6,c3 = 0;
  c3 = c1 ^ c2;
  printf("\n Bitwise XOR i.e. c1 ^ c2 = %d",c3);
}

C Program Write a Program with Bitwise XOR: C1 ^ C2