Hi.
I've written a program to calculate the HCF & LCM for 2 or more numbers. This was originally for integer values only but now I've adapted it.
Basically I turn all the numbers to fractions - using 2 arrays. So 2.0 => 20 and denominator => 10 etc.
HCF is easy to calc. as there is an elegant solution.
In 1 of the web forums it's claimed that the LCM can be deduced by : Product of numbers / HCF.
Do you know if this is true ?
As a well known comedian said "I'm getting the right numbers, but in the wrong order!"
Be obliged for your answer.
Pete
I've written a program to calculate the HCF & LCM for 2 or more numbers. This was originally for integer values only but now I've adapted it.
Basically I turn all the numbers to fractions - using 2 arrays. So 2.0 => 20 and denominator => 10 etc.
HCF is easy to calc. as there is an elegant solution.
In 1 of the web forums it's claimed that the LCM can be deduced by : Product of numbers / HCF.
Do you know if this is true ?
As a well known comedian said "I'm getting the right numbers, but in the wrong order!"
Be obliged for your answer.
Pete
Last edited by a moderator: