public long factorial(long N) {
if (N == 0) {
return 1;
} else {
return N * (factorial(N - 1));
}
}
Method that calculates the factorial of a given number recursively.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.