What is the correct way to define a conditional statement in Ruby?
A. if (condition) { code }
B. if condition then code end
C. if condition: code
D. when condition; code
Answer: Option A
A. if (condition) { code }
B. if condition then code end
C. if condition: code
D. when condition; code
Answer: Option A
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