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

C program, Just need the answers to the following 3 questions. "NO NEED to ...

Just need the answers to the following 3 questions. "NO NEED to write a program compile or run it, do not need it. Just need the answers for the following questions. Example quest

Can i employ realloc() on pointers allocated through new?, A: No.       ...

A: No.       While realloc() need to copy the allocation, this uses a bitwise copy operation, that will tear several C++ objects to shreds. C++ objects must be allowed to copy t

Stream input and output functions, Within C we access external devices by ...

Within C we access external devices by means of a pointer i.e. address. The address could point to any memory mapped device i.e. Ram, Rom, Duart, Disk drives etc. Therefore there i

Quicksorting in linked lists, How do i write a code in C++ to bubblesort in...

How do i write a code in C++ to bubblesort in linked list

Explain register variable, Explain Register Variable Computers have int...

Explain Register Variable Computers have internal registers, which are used to keep data temporarily, before any operation can be performed. Intermediate results of the calcula

How can i present printing for my class fred?, A: Use operator overloading ...

A: Use operator overloading to present a friend left-shift operator, operator #include class Fred { public: friend std::ostream& operator ... private: int i_; // onl

Source code for decoe to code, i am using mobile phone if i want to communi...

i am using mobile phone if i want to communicate via massage but that should be very secret

Why can''t one open a file in a different directory , Why can't one open a ...

Why can't one open a file in a different directory like "..\test.dat"? A: Since " " is a tab character. You must employ forward slashes in your filenames, even on operating s

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