2.
What is the role of ! at the end of the capitalize method?

3.
What will be the output of the given code?
"I'am learning Ruby Language".length.reverse.upcase

7.
What is the output of the given code?
 x, y, z = 12, 36, 72
    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 }."

8.
What is the output of the given code?
print "What's your first name?"
   first_name=gets.chomp
   a=first_name.capitalize
   a=a.reverse
   puts"My name is #{a}"

Read More Section(Basic Syntax in Ruby)

Each Section contains maximum 100 MCQs question on Basic Syntax in Ruby. To get more questions visit other sections.