71. What is the output of the given code?
"Ruby Language".length
= begin
calculate length
= end
"Ruby Language".length
= begin
calculate length
= end
72. What will be the output of the given code?
"I'am learning Ruby Language".reverse.upcase.length
"I'am learning Ruby Language".reverse.upcase.length
73. Why do we use comments?
74. How to comment multiple lines in ruby?
75. What will be the output of the given code?
"Come let's learn.reverse Ruby.length language".upcase
"Come let's learn.reverse Ruby.length language".upcase
76. What is the output of given code?
string="I'am Learning RUBY Language".downcase
string.upcase
string="I'am Learning RUBY Language".downcase
string.upcase
77. 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}"
78. What is the output of the following?
ruby.reverse
ruby.reverse
79. What is the output of the given code?
print "what's your first name?"
first_name=gets.chomp
a=first_name.capitalize
"first_name.capitalize!".reverse
puts"My name is #{first_name}"
print "what's your first name?"
first_name=gets.chomp
a=first_name.capitalize
"first_name.capitalize!".reverse
puts"My name is #{first_name}"
80. What is the output of the following?
"Iam learning ruby language".length
"Iam learning ruby language".length
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.