Home / Programming MCQs / Ruby MCQs / Question
V
Q. What will be the output of the given code?
num=4>>2 puts num
Explanation:
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
What does the take_while method do in Ruby enumerators?
In Ruby, what is the purpose of the -> (stabby lambda) syntax?
What will be the output of the given ruby code?
Which of the method is used to returns the contents of the file line by line?
What is the purpose of using exception handling in Ruby?
Which method is used to write content in the file ?
What is the purpose of abstraction in OOP?
What is the method used to check if a variable is of a specific class in Ruby?
What is the method used to access instance variables in Ruby?
Discusssion
Login to discuss.