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
Program to design list in c: Write a program in c to insert the values in list void main() { int i=0; char a[20]; clrscr(); printf("Enter the line\n");

Write a C program to input three real numbers and  print them out as follows : The first variable is ....... and the second one is ...... The last variable is .......... T

Converting Base Type to Class Type (char to string)   class String { char *name; int length; public: String(void) {length =0; name = new char[length+1];

Constructor public class ListNode {    // package access members; List can access these directly private E data; // data for this node privateListNode nextNode; /

1. Using Visual C++ and your OpenGL configured environment, write an application that displays a “unique” graphical scene that you designed and coded for this course. What yo

Binomial coefficients are the numeric factors of the products in a power of a binomial such as (x + y)n. For example, (x + y)2 = x2 + 2 x y + y2 has the coefficients 1 2 1. Binomia

Raj is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''{'' and end with ''}''. Ã

implement two stacks in one array A[1...n] in such a way that neither stack overflows unless the total number of elements in both stacks together is n. For this you need to produce

I started preparing an alternative cryptocurrency and I am way over my head. I would like help in making modifications to the open source files and then help with deployment. I wil