Basic Syntax In Ruby - Study Mode
[#86] Why do we use comments?
Correct Answer
(D) All of the mentioned
[#87] How to comment multiple lines in ruby?
Correct Answer
(A) Using multiline comments
[#88] What will be the output of the given code? "Come let's learn.reverse Ruby.length language".upcase
Correct Answer
(C) "COME LET'S LEARN.REVERSE RUBY.LENGTH LANGUAGE"
[#89] What is the output of given code? string="I'am Learning RUBY Language".downcase
string.upcase
Correct Answer
(B) "I'AM LEARNING RUBY LANGUAGE"
[#90] 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}"
Correct Answer
(B) What's your first name? amil What's your last name? jones My name is Amil Jones