Current location - Music Encyclopedia - Dating - Find the greatest common divisor and least common multiple of any two positive integers.
Find the greatest common divisor and least common multiple of any two positive integers.

Principle:

Finding common divisors: always divide a large number by a smaller number, leaving a remainder to replace the original large number. if a>b {a=a%b else b=b%a}

Repeat this process

Until the remainder=0, the other number is the common divisor

p>

Common multiple = two numbers multiplied by a common divisor.