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 10110001 has its most significant bit set to 1, indicating it represents a negative number in two's complement form. When right-shifted by 2 positions (x>>2), the sign bit (1) is preserved through sign extension, so the result remains negative. Arithmetic right shift maintains the sign of the original number.