ProgrammingHardTCS NQT · Infosys

What is lcm(12, 18)?

  1. A. 6
  2. B. 72
  3. C. 36
  4. D. 24

Correct answer: C. 36

lcm(a,b) = a / gcd(a,b) * b = 12 / 6 * 18 = 36. Dividing before multiplying keeps the intermediate value smaller.

More C Programming questions

Exams that ask this topic