Home / Programming MCQs / Ruby MCQs / Question
M
Q. What is the output of the given code? for counter in 1..5 case counter when 0 .. 2 puts counter puts "baby" when 3 .. 6 puts counter puts "little child" when 7 .. 12 puts counter puts "child" else puts counter puts "adult" end end
No solution found for this question.
Add Solution and get +2 points.
You must be Logged in to update hint/solution
What is the purpose of the attr_accessor method in Ruby classes?
What will be the output of the given code?
Which method is used to create a new instance of a class in Ruby?
What will be the output of the given code?
Reserved word can not be used as?
What is the syntax for defining a method in Ruby?
What will the following expression evaluate to? (true && false) | | (!true)
What does the 'w' file mode in Ruby signify?
In Ruby, what is the purpose of the `super` keyword when used in a method?
Discusssion
Login to discuss.