Ruby - Methods
What will be the output of this Ruby code?
def add(a, b) a + b end puts add(3, 4)
def add(a, b) a + b end puts add(3, 4)
add takes two parameters a and b and returns their sum a + b.add(3, 4) returns 3 + 4 = 7, which is printed by puts.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions