Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
10 lines (8 sloc) 116 Bytes
n = gets.to_i;
def factorial(n)
if n <= 1
return 1
end
return n * factorial(n - 1)
end
puts factorial(n)
You can’t perform that action at this time.