12 lines
No EOL
164 B
Ruby
12 lines
No EOL
164 B
Ruby
#!/usr/bin/ruby
|
|
|
|
# Program to find the factorial of a number
|
|
def fact(n)
|
|
if n == 0
|
|
1
|
|
else
|
|
n * fact(n-1)
|
|
end
|
|
end
|
|
|
|
puts fact(ARGV[0].to_i) |