This should be something that you can think about for a while and derive.
But I guess you guys want all the answers, here's the full code for deriving the least common multiple.
Code:
int GCD(int a, int b)
{
int r;
while(b)
{
r = a % b;
a = b;
b = r;
}
return(a);
}
int LCM(int a, int b)
{
return a * b / GCD(a, b);
}