by Dinesh Thakur Category: C Programming (Pratical)

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

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.