Data Types And Variables In Ruby MCQs
Practice Data Types And Variables In Ruby MCQs for competitive exams.
Data Types And Variables In Ruby MCQs
Practice questions from this topic.
What is the output of the expression: 7 / 2 in Ruby?
Correct Answer: A
In Ruby, what is the default file extension for Ruby files?
Correct Answer: C
What is the correct way to declare and initialize an array in Ruby?
Correct Answer: A
In Ruby, what is the keyword used to define a constant?
Correct Answer: C
What is the result of the expression: 10 % 3 in Ruby?
Correct Answer: A
What is the method used to check if a string contains a specific substring in Ruby?
Correct Answer: C
Which of the following is the correct way to define a variable in Ruby?
Correct Answer: A
What is the method used to check if a variable is of a specific class in Ruby?
Correct Answer: A
Which method is used to convert a string to an array of characters in Ruby?
Correct Answer: D
What is the output of the expression: "10" * 3 in Ruby?
Correct Answer: A
What is the method used to check if a variable is numeric in Ruby?
Correct Answer: B
Which of the following is the correct way to declare a variable in Ruby with a default value?
Correct Answer: A
