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

  • برمجة روبي
  • برمجة

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

الأجوبة

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
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...