Given two positive integers, return their greatest common divisor (GCD). The GCD is the largest number that divides both inputs without a remainder. If either input is negative, return null.
Function Signature
gcd(x, y)
Parameters
x — an integer.
y — an integer.
Output
Return a number representing the GCD of x and y, or null if either value is negative.