What is the output of the given code?
“Ruby”.length #to find the length of given string
“Ruby”.length #to find the length of given stringA. 4 to find the length of given string
B. 4
C. To find the length of given string
D. Ruby
Answer: Option B
Related Questions on Basic Syntax in Ruby
What does the 'puts' method do in Ruby?
A. Prints to console
B. Converts to string
C. Finds the length
D. Reads input from user

Join The Discussion