Basic Syntax In Ruby - Study Mode
[#111] What is the output of the given code? print "What's your first name?"
first_name=gets.chomp
a=first_name.capitalize
a=a.reverse
puts"My name is #{a}"
Correct Answer
(B) What's your first name? amil My name is Amil
[#112] What is the output of the given code? Ans=Ruby
puts "#[Ans] is an oop language"
Correct Answer
(B) Ruby is an oop language
[#113] Objects of which class does the integer from the range -2^30 to 2^(30-1) belong to?
Correct Answer
(C) Fixnum
[#114] Which of the following is the correct way to start a single-line comment in Ruby?
Correct Answer
(C) #
[#115] In Ruby, what is the keyword used to define a class?
Correct Answer
(A) class