Select an option to see the answer and solution.
Basic Syntax in Ruby
practice.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
134
Questions
5/7
Page
Pick an option on a question to see the right answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
puts "My name is #{Name}"Select an option to see the answer and solution.
Select an option to see the answer and solution.
print "Hey"
puts "Everyone!"
print "We are learning Ruby"Select an option to see the answer and solution.
Select an option to see the answer and solution.
print "What's your address"
city,state,pin=gets.chomp,gets.chomp,gets.chomp
puts "Iam from #{city} city, #{state} state, pincode: #{pin} "Select an option to see the answer and solution.
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}"Select an option to see the answer and solution.
Select an option to see the answer and solution.
my_string=Ruby
puts(my_string)Select an option to see the answer and solution.
“Ruby”.length #to find the length of given stringSelect an option to see the answer and solution.
Select an option to see the answer and solution.
print "what's your first name?"
first_name=gets.chomp
a=first_name.capitalize
"a".reverse
puts"My name is #{a}"Select an option to see the answer and solution.
boolean_1 = 77<78
puts(boolean_1)Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
Q100
Open question"Ruby".reverse.upcaseSelect an option to see the answer and solution.