Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What is the output of the given code?
Ans=Ruby
puts “#{Ans} is an oop language”
puts “It is very efficient langauge”
puts “#{expr} is used on rails platform”

What is the output of the given code?
Ans=Ruby
puts “#{Ans} is an oop language”
puts “It is very efficient langauge”
puts “#{expr} is used on rails platform”
a) Error, no output
b) Ruby is an oop language
It is very efficient langauge
undefined local variable
c) Ruby is an oop language
It is very efficient langauge
#{expr} is used on rails platform
d) None of the mentioned

Answer: b
Explanation: The Local variable used is expr which is not defined.
Output:
Ruby is an oop language
It is very efficient langauge
undefined local variable or method `expr’ for #

Join The Discussion