Examveda

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

B. 102

C. -98

D. None of the mentioned

Answer: Option A


This Question Belongs to Ruby Programming >> Control Structures In Ruby

Join The Discussion

Related Questions on Control Structures in Ruby