Ruby gets.chomp

puts "What is your first Name" first_name = gets.chomp puts "What is your last Name" last_name = gets.chomp puts "Thank you, you said your first name is '#{first_name}' and your last name is '#{last_name}'" full_name_reversed = (first_name + ' ' + last_name).reverse puts "Your full name reversed is '#{full_name_reversed}' and this word has #{full_name_reversed.length} characters "

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.