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 the given code?
puts “My name is #{Name}”

What is the output of the the given code?
puts “My name is #{Name}”
a) Error in compilation
b) Name variable not defined earlier
c) My name is #{Name}
d) Undefined Error

Answer: b
Explanation: Ruby doesn’t recognize the Name variable as it is not declared.
Output:
Name variable not defined

Join The Discussion