You are viewing a single comment's thread. Return to all comments →
def factorial yield end
n = gets.to_i factorial do f=1 (1..n).map { |a| f=f*a} puts f end
Seems like cookies are disabled on this browser, please enable them to open this website
Blocks
You are viewing a single comment's thread. Return to all comments →
def factorial yield end
n = gets.to_i factorial do f=1 (1..n).map { |a| f=f*a} puts f end