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

Friends of classes, Define the following Window class : - integer  data mem...

Define the following Window class : - integer  data members, width and height - a constructor  that accepts two integer  parameters  (width followed by height) and uses them to ini

Program for basically a small store, ¦It should ask customers to enter deta...

¦It should ask customers to enter details such as their names and addresses. ¦It should print a welcome message that includes the customer’s name. ¦It should provide a list of avai

Explain static member functions, Static Member Functions All the object...

Static Member Functions All the objects of the class share static data members of a class. The example above demonstrates how to keep track of all the objects of a class which

Implementing Dynamic Binding for RPC, i didnt no how to write and how to im...

i didnt no how to write and how to implement and the programming can be done in C and execution should be done in UNIX

Creating shopping carts, how to create a shopping cart and sibmit the code ...

how to create a shopping cart and sibmit the code segment on screan

Bankers algorithm, creating a system having five process from p0 to p4 and ...

creating a system having five process from p0 to p4 and five resource types. create the need matrix use the safe algorithm to test if the system is in safe mode.

Program to Find the Factorial of a Given Number, Program1: Write a progr...

Program1: Write a program to find the factorial of a given number. The input is user given. Final output is printed out on to the screen. Program2: Write a program to gene

Tree, Write algorithm and program for the conversion of a Tree to a Binary ...

Write algorithm and program for the conversion of a Tree to a Binary Tree

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