If the past lessons on GCDs (here and here weren't enough for you, we now
turn our attention to the LCM which stands for "least common multiple." The LCM is the smallest number that is a
multiple of two numbers.

We introduce it here because the LCM can be calculated from the GCD using this formula:

$$LCM(a,b)=\frac{a\cdot b}{GCD(a,b)}$$

Type your code here:

See your results here:

This program will not run! You have to fill in the

`return( )`

statement in the function `lcm(a,b)`

to compute the LCM of two numbers a and b, based on the formula involving the GCD above. Can you do it?
Dismiss.
Does your code work? Want to run it on your iPhone?

Here's your code:

- Use [Control]-[C] (Windows) or [⌘]-[C] (MacOS) to copy your code.
- Paste it using [Control]-[V] (Windows) or [⌘]-[V] (MacOS) into
this page
- Then click the "Use on iPhone" button that you'll see.