smallest common multiple algorithm code example Example: least common multiple algorithm lcm = a / gcd * b;