Define bitwise-shift operators, C/C++ Programming

Define Bitwise-Shift Operators?

The shift operators perform suitable shift by operator on the right to the operator on the left. The right operator should be positive. The vacated bits are filled with zero that is there is NO wrap around.

For example: x << 2 shifts the bits in x by 2 places to the left.


if x = 00000010 (binary) or 2 (decimal)



609_Define Bitwise-Shift Operators.png

0 (decimal)

Also: if x = 00000010 (binary) or 2 (decimal)


1379_Define Bitwise-Shift Operators 1.png

8 (decimal)

Consequently a shift left is equivalent to a multiplication by 2.  Likewise a shift right is equal to division by 2 

NOTE: Shifting is much faster in comparison of actual multiplication (*) or division (/) by 2 thus if you want fast multiplications or division by 2 use shifts.

Posted Date: 6/14/2013 1:42:11 AM | Location : United States

Related Discussions:- Define bitwise-shift operators, Assignment Help, Ask Question on Define bitwise-shift operators, Get Answer, Expert's Help, Define bitwise-shift operators Discussions

Write discussion on Define bitwise-shift operators
Your posts are moderated
Related Questions
differentiate between inbuilt and user defined functions

Passing and Returning Objects Objects can be passed to a function and returned back just like normal variables. When an object is passed by content, the compiler makes another

I need a project on car rental system using c programming only of college level

Important Note: No course works, which have been submitted via hard copies or emails, will be accepted a short essay below edited in a document (word, other) files with

how c program starts executing?

Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code

#Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.   #include float start_poi


how to learn programming skills

What are some guidelines / "rules of thumb" for overloading operators? A: Here are a few guidelines / rules of thumb .Use common sense. If your overloaded operator makes life si