Basic Syntax In Ruby - Study Mode
[#21] What is the output of the given code? “Ruby”.length #to find the length of given string
Correct Answer
(B) 4
[#22] Which of the following is not a valid library function?
Correct Answer
(D) Get
[#23] What is the output of the given code? print "what's your first name?"
first_name=gets.chomp
a=first_name.capitalize
"a".reverse
puts"My name is #{a}"
Correct Answer
(B) What's your first name? amil My name is Amil
[#24] What is the output of the given code? boolean_1 = 77<78
puts(boolean_1)
Correct Answer
(B) True
[#25] Ruby can deal with both numbers and floating point values.
Correct Answer
(A) True