Basic Syntax In Ruby - Study Mode

[#91] What is the output of the following? ruby.reverse
Correct Answer

(D) Undefined local variable ruby

[#92] 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}"
Correct Answer

(B) What's your first name? amil My name is amil

[#93] What is the output of the following? "Iam learning ruby language".length
Correct Answer

(A) 26

[#94] What is the use of .capitalize method?
Correct Answer

(B) It capitalize on the first letter of the string

[#95] Which of the following is not a valid datatype?
Correct Answer

(D) Timedate