Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Recursive factorial
SUBMITTED BY:
Guest
DATE:
Jan. 16, 2014, 6:50 p.m.
FORMAT:
C#
SIZE:
198 Bytes
Raw
Download
Tweet
HITS:
867
Go to comments
Report
static
int
RecursiveFactorial
(
int
value
)
{
if
(
value
<
0
)
throw
new
Exception
(
"Bad boy!"
);
if
(
value
==
0
)
return
1
;
return
value
*
RecursiveFactorial
(
value
-
1
);
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus