325nH1 Could you please help me to solve this problem Write
325nH1) Could you please help me to solve this problem?
Write the following ML function: (ONLY WITH METALANGUAGE, ML)
Write a function which takes two integer list parameters and if they are of equal size, finds the product of all elements in both lists. Otherwise, the function should return 0.
Note: Write only one function.
Sample Run:
- mult([4,8,2],[1,2,5]); //Product of 4,8,2,1,2,5 is 640
val it = 640 : int
- mult([4,8],[1,2,5]); //different lengths
val it = 0 : int
- mult([4,8,2,9],[1,2,5]); //different lengths
val it = 0 : int
Solution
Note: Run the code without missing the intendation.
