cours0708/P5B/ruby/factorielle.rb

12 lines
103 B
Ruby

def fact(n)
if n == 0
then
1
else
n * fact(n-1)
end
end
puts fact(5)
puts "Hello World"