Returning


#1

I got pass the code but it prints an error instead of the output.
This is the thing prints out in my console. "undefined local variable or method `n1' for #"

I dont know why, this is my code:

def add(n1, n2)
return n2 + n1
print add
end

add(n1,n2)


#2

@jfrancis21,

1.
You will have to call your add() function
with 2 arguments each having a number Value
like

print add(1,2)

2
If the interpreter encountered a return statement
the function will be exited....
thus your print will NOT be executed.