Home / Programming MCQs / Ruby MCQs / Question
V
Q. What will be the output of the given code?
boolean_var = false || -20 > -18 puts boolean_var
Explanation:
20 is not greater than -18 hence the output will be false || false which is false.
You must be Logged in to update hint/solution
Which keyword is used to refer to the current instance of a class in Ruby?
What is the purpose of inheritance in OOP?
What does the lambda? method do in Ruby?
What is the main advantage of using OOP principles in programming?
What is the data type of the value 3.14 in Ruby?
What does the && operator do in Ruby?
What is the purpose of the next keyword in a loop in Ruby?
Discusssion
Login to discuss.