-
Factoring
I know I can use a calculator, but I want to program my own :D . I am new in c++ I am now having a problem finding the lowest common multiple of two numbers. :( I can't seem to find information on how to factor a number down so I can do this. So I need help on how to factor a number. I know how to capture it into pices if I can only get it to give me the factor of the number as a single digit. :confused:
please help me.
-
Don't do it that way. Do it this way:
lcm(x,y) = x / gcd(x,y) * y
Finding the gcd is simple enough and doesn't require factoring. (Search for Euclid's algorithm.)