def factorial(n)
if n == 0
return 1
else
return n * factorial(n - 1)
end
end
13 Ağustos 2007 Pazartesi
Recursive program to compute n!
Subscribe to:
Kayıt Yorumları (Atom)
ajax, asp, asp.net, php, delphi, ruby, c#, visual basic, vb.net, Perl, c/c++, java, python, html codes
def factorial(n)
if n == 0
return 1
else
return n * factorial(n - 1)
end
end
0 Comments:
Post a Comment