Vidyalelo
Ruby Programming · Q20

Basic Syntax in Ruby

Programming · Ruby Programming · question 20

Q20

What is the correct way to define a conditional statement in Ruby?

A.
if (condition) { code }
Answer
B.
if condition then code end
C.
if condition: code
D.
when condition; code

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board