Explain bitwise left shift and right shift operators, Computer Engineering

Assignment Help:

Bitwise Left Shift and Right Shift Operators: <<, >>

shift-expression :

additive-expression

shift-expression << additive-expression shift-expression >> additive-expression

The bitwise shift operators shift their first operand left (<<) or right (>>) by the number of positions the second operand specifies.

Example

In the following example, the right shift operator moves the data bits two positions to the right, thus changing the value of nNumA:

// Example of the bitwise right shift operator

int nNumA=8;   // beginning value is 8

nNumA >> 2;    // ending value is 2

 


Related Discussions:- Explain bitwise left shift and right shift operators

Main benefits of cd-rom, The main benefits of CD-ROMs are: These are...

The main benefits of CD-ROMs are: These are removable disks, thus they are suitable for archival storage mass replication is cheap and fast large storage capacity

Illustrate about packet switching, Q. Illustrate about Packet switching? ...

Q. Illustrate about Packet switching? Packet switching is used to avoid long delays in transmitting data over the network. Packet switching is a technique that limits the amoun

What is the cih, CIH, also known  as Chernobyl or Spacefiller, is a Microso...

CIH, also known  as Chernobyl or Spacefiller, is a Microsoft Windows computer virus which first emerged in 1998. It is one of the most damaging viruses, overwriting critical inform

Quiz help, which two class die class contain in computer programing.

which two class die class contain in computer programing.

What is the difference between dpi and ppi, Question : (a) "Resolution ...

Question : (a) "Resolution refers to the sharpness and clarity of an image" (i) Explain what you understand by the above statement. (ii) What is the difference between D

Subtraction of 01100-00011 using 2's complement method, Subtraction of 0110...

Subtraction of 01100-00011 using 2's complement method Ans. Firstly 1's complement of 00011 is 11100 and 2's complement is 11100 + 1 = 11101. Thus If a last carry is

Embedded, explain djnz instruction of intel 8051 microcontroler

explain djnz instruction of intel 8051 microcontroler

C PROGAMM, CODING FOR...WHAT IS THE PROBABILITY THAT A CARD DRAWN FROM A PA...

CODING FOR...WHAT IS THE PROBABILITY THAT A CARD DRAWN FROM A PACK OF 52 CARDS WILL BE A DIAMOND OR A KING .

Define colgroup tag, COLGROUP defines a group of columns in table and...

COLGROUP defines a group of columns in table and allows you to set properties of those columns. goes immediately after tag and before an

Define assembly, Define Assembly Assembly is a one deployable unit that...

Define Assembly Assembly is a one deployable unit that contains information about the execution of classes, structures and interfaces. it also keeps the information about itsel

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