You are viewing a single comment's thread. Return to all comments →
def factorial(n) total = n for i in 1...n do total *= i end yield total end n = gets.to_i factorial(n) do |num| puts num 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 →