A

Admin • 833K Points
Coach

Q. What will be the output of the given code?

Code:
num=4>>2
puts num
  • (A) -2
  • (B) 0
  • (C) 2
  • (D) 1
  • Correct Answer - Option(D)
  • Views: 29
  • Filed under category Ruby
  • Hashtags:

Explanation by: Admin

left operands value is moved right by the number of bits specified by the right operand.So the answer is 1.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.