Y
Q. What will be output for the following code When input number is ""!""?
Code:
def catch_and_throw(value)
puts value
a = readline.chomp
throw :value_e if a == ""!""
return a
end
catch :value_e do
number = catch_and_throw(""Enter Number: "")
end
puts value
a = readline.chomp
throw :value_e if a == ""!""
return a
end
catch :value_e do
number = catch_and_throw(""Enter Number: "")
end
- Correct Answer - Option(C)
- Views: 137
- Filed under category Ruby
Discusssion
Login to discuss.