Define the bitwise-exclusive-or operator, C/C++ Programming

Assignment Help:

Define the Bitwise-Exclusive-OR Operator: ^:

The bitwise-exclusive-OR operator (^) compares every bit of its first operand to the corresponding bit of its second operand. If one bit is 1and the other bit is 0, the corresponding result bit is set to 1. Or else, the corresponding result bit is set to 0.

x

Y

x ^ y

0

0

0

0

1

1

1

0

1

1

1

0

In the following instance the bitwise-exclusive-OR operator (^) compares the bits of two integers nNumA and nNumB:

// Example of the bitwise-exclusive-OR operator

int nNumA=9, nNumB=3, nNumC; // 00001001, 00000011

nNumC = nNumA ^ nNumB;       // nNumC is now 10: 00001010


Related Discussions:- Define the bitwise-exclusive-or operator

Virtual constructor, Is it possible to have Virtual Constructor? If yes, ho...

Is it possible to have Virtual Constructor? If yes, how? If not, Why not possible?

Padovan.., count the number of string in n-th padovan string

count the number of string in n-th padovan string

Member dereferencing operators, M em b e r d e r e f e r e n c ...

M em b e r d e r e f e r e n c i ng o p e r a t o r s: T h e s e op e r a t o r s w i l l b e d i s c u s s e d l a t

Program to calculate pie, This problem familiarizes you with using random n...

This problem familiarizes you with using random numbers in C++. The program is to compute a good approximation of p using a simulation method called "Monte Carlo". The following fi

Should i call a destructor explicitly on a local variable?, Should I call a...

Should I call a destructor explicitly on a local variable?

C program for reverse the word in string, C Program for REVERSE THE WORD IN...

C Program for REVERSE THE WORD IN STRING #include conio.h> #include stdio.h> #include string.h> void main() {           char a[50],b[25][25],temp;           i

How to double to int, char P[100]; double X=533.8*22500; sprintf(P...

char P[100]; double X=533.8*22500; sprintf(P,"%f %u",X,(unsigned int)X); MessageBox(P,"SSS"); //12010500.000 12010499

Advanced, how to create a shopping cart

how to create a shopping cart

#include, Write a program to find the area under the curve y = f(x) between...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Lexicographically preceding permutation, Respected Sir, I want the above wr...

Respected Sir, I want the above written text in a C program

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd