MCQ Single Best Answer Easy

QIf m is 10 and n is 6, what is the result of the expression m << n using the left shift operator in Java?

ID: #20166 Bitwise Operators 103 views
Question Info
#20166Q ID
EasyDifficulty
Bitwise OperatorsTopic

Choose the Best Option

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

  • A 40
  • B 20
  • C 640
  • D 160
Correct Answer: Option C

Explanation

The left shift operator (<<) in Java shifts the bits of the left operand to the left by the number of positions specified by the right operand. In this case, m << n is equivalent to 00001010 << 00000110, resulting in 010100000000, which is 640 in decimal.

Share This Question

Challenge a friend or share with your study group.