What is the output of the the given code?
puts "My name is #{Name}"
puts "My name is #{Name}"A. Error in compilation
B. Name variable not defined earlier
C. My name is #{Name}
D. Undefined Error
Answer: Option B
Related Questions on Basic Syntax in Ruby
What does the 'puts' method do in Ruby?
A. Prints to console
B. Converts to string
C. Finds the length
D. Reads input from user

Join The Discussion