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

Assignment Help:

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.

So:

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

then:

or

609_Define Bitwise-Shift Operators.png

0 (decimal)

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

or

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.


Related Discussions:- Define bitwise-shift operators

C program to print fibonacci series upto n using recursion, C program to Pr...

C program to Print Fibonacci series upto n using recursion: int fibo(long int); void main() {                 long int a=0,n;                 printf ("how many term

Explain why a linked list is called dynamic data structure, Question: (...

Question: (a) (i) What is recursion? (ii) What advantage is there in its use? (iii) What disadvantage is there in its use? (b) The factorial of a positive number can b

C program to check prime numbers , C Program to check PRIME NUMBERS   ...

C Program to check PRIME NUMBERS   main() {           int i,k,r,flag;           clrscr();           printf("ENTER THE NO. TO CHECK IT IS PRIME OR NOT: ");

Define and explain flow chart with an example, C Programming and Data Struc...

C Programming and Data Structures 1. Define and explain flow chart with an example. 2. Write an algorithm to print all even numbers in descending order and draw the flowcha

Explain default arguments, Default Arguments A default argument is a va...

Default Arguments A default argument is a value that is automatically assigned to a formal variable, if the actual argument from the function call is omitted. e.g. void

Pointers, In this sub-task will you implement three functions for the final...

In this sub-task will you implement three functions for the final three function prototypes that will do exactly the same as the three functions that you have just written. This ti

Develope a program, Develop a program to meet the following requirements: ...

Develop a program to meet the following requirements: 1. Must use at least one function in addition to main (you can use more) 2. Must use selection 3. Must use deference/indire

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