πŸ“Š Ruby
Q. What will be the output of the given code?
Code:
num=4>>2
puts num
  • (A) -2
  • (B) 0
  • (C) 2
  • (D) 1
πŸ’¬ Discuss
βœ… Correct Answer: (D) 1

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

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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
237
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Vinay Kumar
Publisher
πŸ“ˆ
93%
Success Rate