ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
What is the output of the given code
x, y, z = puts "The value of x is #{ x }."
puts "The sum of x and y is #{ x + y }."
puts "The average was #{ (x + y + z)/3 }."
Correct Answer: C — The value of x is 12.
first_name.capitalize! modifies first_name in-place. The prompt itself is printed when the code runs, so output includes the prompt line.