So there is gcd for two numbers, which i know how do define.
gcd a 0 = a
gcd a b = gcd b (a `mod` b)
gcd a b c = gcd3
How could i define a gcd3 for finding the greatest divisor for three numbers. The definition of gcd3 is:
gcd3 :: Int -> Int -> Int -> Int
>Solution :
You can take the gcd of three numbers the same way you take the sum of three numbers: by doing it two at a time.
gcd3 :: Int -> Int -> Int -> Int
gcd3 x y z = (x `gcd` y) `gcd` z