Finding LCM--Driving me nuts

I am having the hardest time finding the lowest common denominator.

I have it set up in a for loop, for the life of me I can't find whats wrong.

Here is what I have so far:

Code:

`for (x=0;x == LCM;++x)`

{

var1 = x * denom1;

var2 = x * denom2;

cout <<var1 <<" " <<var2 <<endl;

if (var2 == var1)

{

x = LCM;

LCM = var1;

cout <<"The LCM is " <<LCM <<endl;

}

}

It doesn't even seem like the for loop is finishing. It doesn't even cout the cout statment, it just continues with the rest of the program.