MCQ Single Best Answer Easy

QIf q is 16 and r is 3, what is the result of the expression q >>> r using the unsigned right shift operator in Java?

ID: #20168 Bitwise Operators 82 views
Question Info
#20168Q ID
EasyDifficulty
Bitwise OperatorsTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 2
  • B 4
  • C 8
  • D 16
Correct Answer: Option B

Explanation

The unsigned right shift operator (>>>) in Java shifts the bits of the left operand to the right by the number of positions specified by the right operand, filling the leftmost bits with zeros. In this case, q >>> r is equivalent to 00010000 >>> 00000011, resulting in 00000010, which is 2 in decimal.

Share This Question

Challenge a friend or share with your study group.