C Programming - Bitwise Operators - Discussion

Discussion Forum : Bitwise Operators - True / False Questions (Q.No. 2)
2.
In the statement expression1 >> expression2. if expression1 is a signed integer with its leftmost bit set to 1 then on right shifting it the result of the statement will vary from computer to computer
True
False
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
12 comments Page 2 of 2.

Santhu said:   1 decade ago
In turbo c integer takes 2-BYTES,
In linux integer takes 4-BYTES.

turbo c: 1000 0000 0000 0000 0000>>1==>>0100 0000 0000 0000
the above value equalent to: 35,767

Linux: 1000 0000 0000 0000 0000 0000 0000 0000>>1
the above value is equalent to: 2,147,483,647

This is the main reason

Super said:   1 decade ago
why? i cant understand


Post your comments here:

Your comments will be displayed after verification.