Q:

Write a Ruby program which accept the user's first and last name and print them in reverse order with a space between them

0

Write a Ruby program which accept the user's first and last name and print them in reverse order with a space between them.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Ruby Code:

puts "Input your first name: "
fname = gets.chomp
puts "Input your last name: "
lname = gets.chomp
puts "Hello #{lname} #{fname}"
Output:
Input your first name: 
Input your last name: 
Hello Lanoie Gary

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now