Question: Please do the code for this in OCaml. Part 2 : Recursive Functions Implement the following functions using recursion. pow ( x:int, p:int ) Type:
Please do the code for this in OCaml.
Part : Recursive Functions
Implement the following functions using recursion.
pow x:int, p:int
Type: int int int
Description: Returns x raised to the power p
Assumptions: p is nonnegative, and we will not test your code for integer overflow cases.
Examples:
pow
pow
pow
fac x:int
Type: int int
Description: Returns the factorial of as an integer.
Assumptions: You may assume the answer is nonnegative,
Examples:
fac
fac
fac
fac
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
