Vidyalelo
Ruby Programming · Q68

Control Structures in Ruby

Programming · Ruby Programming · question 68

Q68

What is the output of the given code? a=10 b=2 if a>b a=a*b puts (a) elsif a<b a=a*a+b puts (a) else a=a-b puts (a) end

A.
20
Answer
B.
102
C.
-98
D.
None of the mentioned

Answer: Option A

Solution

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