Home / Programming MCQs / Ruby MCQs / Question
V
Q. What will be the output of the given code?
num=(10<11)||(11===11)? (11===11.0): 0 puts num
Explanation:
First check 10<11 it return true then no need to check 11===11 , condition becomes true now go to next statement 11===11.0 and it will return true.
You must be Logged in to update hint/solution
What is the primary purpose of the else keyword in Ruby exception handling?
What is true about Until loop?
What is the output of the given code? m=0 loop do puts m*10 m+=1 break if m==5 end
What does the protected keyword do in Ruby classes?
What does the gem specification gem_name command do in Ruby?
What is the correct syntax for defining a variable in Ruby?
Which Ruby convention is commonly used for naming global variables?
Discusssion
Login to discuss.