11. What is the result of the expression: 5 / 2 in Ruby? A. 2 B. 2.5 C. 2 D. 3 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
12. Which of the following is the correct way to declare a constant in Ruby? A. CONSTANT_NAME = value B. constant_name : value C. constant_name = value D. constantName(value) Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
13. Which method is used to check if a variable is nil in Ruby? A. .is_nil? B. .nil? C. .empty? D. .null? Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
14. What is the method used to check the data type of a variable in Ruby? A. .type B. .typeof C. .class D. .datatype Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
15. What is the output of the expression: "5" + "2" in Ruby? A. "7" B. 7 C. 52 D. Error Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
16. What is the method used to check if a variable is defined in Ruby? A. .is_defined? B. .defined? C. .exist? D. .has_value? Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
17. What is the correct syntax to declare and initialize a variable in Ruby? A. var_name = value B. var var_name = value C. variable var_name = value D. variable_name = value Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
18. Which of the following is a valid way to declare a variable in Ruby? A. myVar = 10 B. 10 = myVar C. myVar D. myVar = "10" Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
19. What is the data type of the value "Hello, World" in Ruby? A. Integer B. Float C. String D. Boolean Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
20. What is the method used to check if a variable is empty in Ruby? A. .empty? B. .is_empty? C. .null? D. .has_content? Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board