Question: Please Solve with OCaml programing and I will give you tamp 1. Tail Recursion Write a tail-recursive function fact : int -> int that calculates
Please Solve with OCaml programing and I will give you tamp
1. Tail Recursion
Write a tail-recursive function fact : int -> int that calculates the factorial of an argument n (that is, n!).
Remember that n! = n (n 1) (n 2) . . . 1
0! = 1 1! = 1 2! = 2
. . .
Base Code: let fact (n: int) : int = raise ImplementMe ;;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
