Question: the language is Haskell 5) Define function greatestCommonDiv that receives two numbers as input and returns the greatest common divisor of those two input numbers.
the language is Haskell
5) Define function greatestCommonDiv that receives two numbers as input and returns the greatest common divisor of those two input numbers. For example, if the inputs are 24 and 30, then the output would be 6. You may use maximum function along withcommonDivdefined earlier.Note: function gcd is already part of standard library. Do not use that! Hint:Given numbers n and m, callcommonDivon them and return the biggest element of that list.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
