81. What is the use of .capitalize method?
82. Which of the following is not a valid datatype?
83. Ruby is an object oriented general purpose programming language.
84. What is the output of the the given code?
puts "My name is #{Name}"
puts "My name is #{Name}"
85. What does %Q{ Learn ruby language } represents?
86. What is the output of the given code?
print "Hey"
puts "Everyone!"
print "We are learning Ruby"
print "Hey"
puts "Everyone!"
print "We are learning Ruby"
87. Ruby can be embedded into Hypertext Markup Language(HTML).
88. What is the output of the given code?
print "What's your address"
city,state,pin=gets.chomp,gets.chomp,gets.chomp
puts "Iam from #{city} city, #{state} state, pincode: #{pin} "
print "What's your address"
city,state,pin=gets.chomp,gets.chomp,gets.chomp
puts "Iam from #{city} city, #{state} state, pincode: #{pin} "
89. 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}"
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}"
90. What do we mean by expression substitution?
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.