Answers for "how to find factorial of a number using recursion"

2

recursion factorial algorithm

FUNCTION FACTORIAL (N: INTEGER): INTEGER
(* RECURSIVE COMPUTATION OF N FACTORIAL *)

BEGIN
  (* TEST FOR STOPPING STATE *)
  IF N <= 0 THEN
    FACTORIAL := 1
  ELSE
    FACTORIAL := N * FACTORIAL(N - 1)
END; (* FACTORIAL *)
Posted by: Guest on December-29-2020

Code answers related to "how to find factorial of a number using recursion"

Code answers related to "Javascript"

Browse Popular Code Answers by Language