Explain the bitwise-inclusive-or operator, C/C++ Programming

Assignment Help:

Explain the Bitwise-Inclusive-OR Operator: |?

The bitwise-inclusive-OR operator (|) contrast each bit of its first operand to the corresponding bit of its second operand and if either bit is 1 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

1

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

// Example of the bitwise-inclusive-OR operator

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

nNumC = nNumA | nNumB;       // nNumC is now 11: 00001011


Related Discussions:- Explain the bitwise-inclusive-or operator

Luminous jevel, Ask queByteland county is very famous for luminous jewels. ...

Ask queByteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colo

Battleship game, Create a program to print a battleship grid to the console...

Create a program to print a battleship grid to the console and mark squares as destroyed

File Input and Output, Given a bool variable isReadable write some statem...

Given a bool variable isReadable write some statements that assign true to isReadable if the file "topsecret" exists and can be read by the program and assigns false to isR

Explain public derivation, Public derivation Public derivations are muc...

Public derivation Public derivations are much more common than private derivations. In this situation: The private members inherited from the base class are inaccessible

Oop, what is oop?

what is oop?

Algorithm, What is an algorithm and write an algorithm to calculate the sim...

What is an algorithm and write an algorithm to calculate the simple interest

Padovan string, #questio#A Padovan string P(n) for a natural number n is de...

#questio#A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string

Explain recursive functions, Recursive Functions Recursion is a process...

Recursive Functions Recursion is a process by which a function includes itself with a condition for its safe exit. It is best suitable for a recursive problem. A typical exampl

Wap to swap the three digit number, WAP TO SWAP THE THREE DIGIT NUMBER ...

WAP TO SWAP THE THREE DIGIT NUMBER void main () { int b,r,n,r1,r2; clrscr (); printf ("Enter the Value: "); scanf ("%d",&n); r=n%10; n=n/10; r1=n%10;

Define variable declaration in c++, Variable Declaration This declarati...

Variable Declaration This declaration of variables in the C language is permitted only in the starting of their block, prior to executable program statements. In C++ declaratio

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