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

Private member functions, P r i va t e Member Functions: A private...

P r i va t e Member Functions: A private member functions can be called by the members of the same class.  Consider the following example.   c l a ss sample

#title., #quGiven the Array class definition in Fig. 11.10-11.11 (pp. 476-4...

#quGiven the Array class definition in Fig. 11.10-11.11 (pp. 476-479) of the textbook, write a new overloaded operator function for the ‘%’ (modulus) operator (i.e., return an arra

What does extern "c" int func(int *, A: This will turn o_ "name mangling" f...

A: This will turn o_ "name mangling" for func so that one can connect to code compiled by a C compiler.

Lowest cost entry, code for solving optimal solution for matrix

code for solving optimal solution for matrix

Super ansii prgm, Ask quIn the Byteland country a string "s" is said to sup...

Ask quIn the Byteland country a string "s" is said to super ascii string if and only if count of each charecter in the string is equal to its ascci value in the byteland country as

Inverted Index Implementation, Need help finishing my homework. It''s been ...

Need help finishing my homework. It''s been 5 years since I''ve use C++. I am a VN.Net programmer. -Todd

string to palindrome, A palindrome is a string that reads the same from b...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

I want rss feed from emails, Project Description: I am trading binary op...

Project Description: I am trading binary options and need my signals that are sent to me via email to be sent to my followers via an RSS feed I have no idea how rss feeds imp

Explain the #undef directive, The #undef Directive This directive undef...

The #undef Directive This directive undefines a previously explained macro. For, example the following will give an error since PI is undefined.                 #define PI 3

Lexicographic permutation, Given an integer n and a permutation of numbers ...

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

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