Please give me an idea how to show all the bits of a number using bitwise shift operator....and hence represent the number in 2's complement representation

Printable View

- 03-30-2013progmateurhomework help bitwise shift
Please give me an idea how to show all the bits of a number using bitwise shift operator....and hence represent the number in 2's complement representation

- 03-30-2013Neo1
You can use bitwise-and like so to get the least significant bit:

Code:`int myNumber;`

int myBit = myNumber & 1;