Computer Science, asked by NAGASAKI7104, 1 year ago

Difference between signed and unsigned shift operator c

Answers

Answered by kaumodaki2003
0

Answer:

So right shift operator preserves sign bit and keep positive number as positive. That's all about difference between right shift and unsigned right shift operator in Java. ... For positive inputs, both signed and unsigned right shift will produce same result but for negative numbers they will produce different result

Explanation:

Answered by sahasubir8
0

For a signed integer one bit is used to indicate the sign - 1 for negative, zero for positive. Thus a 16 bit signed integer only has 15 bits for data whereas a 16 bit unsigned integer has all 16 bits available. This means unsigned integers can have a value twice as high as signed integers (but only positive values).

Attachments:
Similar questions