Find the greatest common divisor and the least common multiple of any two positive integers.

Principle:

Find the common divisor: always divide a larger number by a smaller number, leaving a remainder instead of the original large number. If a>b {a=a%b else b=b%a}

Repeat this process.

Until the remainder = 0, another number is the common divisor.

Common multiple = the product of two numbers divided by the common divisor.