Multiple choice technology programming languages

Assume the bit pattern of byte x is: 10110001. What will the sign of x be after x>>2?

  1. postive

  2. negative

  3. can't be find

  4. none of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The byte pattern 10110001 has the most significant bit set to 1, indicating it represents a negative number in two's complement form. The signed right shift operator (>>) preserves the sign bit during shifting, so after x>>2, the result remains negative.