What is the output of the code? print "What's your first name?" first_name=gets.chomp a=first_name.capitalize first_name.capitalize! print "What's your last name?" last_name=gets.chomp b=last_name.capitalize last_name.capitalize puts "My name is #{first_name} #{last_name}"

Question:
What is the output of the code?

print "What's your first name?"
   first_name=gets.chomp
   a=first_name.capitalize
   first_name.capitalize!
   print "What's your last name?"
   last_name=gets.chomp
   b=last_name.capitalize
   last_name.capitalize
   puts "My name is #{first_name} #{last_name}"

1.Amil Jones

2.What’s your first name? amil What’s your last name? jones My name is Amil Jones

3.What’s your first name? amil What’s your last name? jones My name is Amil jones

4.None of the mentioned

Posted Date:-2022-02-07 11:54:47


More MCQS Questions and answers

Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!