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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!