Finding LCM and HCF of two numbers.
LCM: The least common multiple of a number is the smallest number that is the product of two or more numbers.
Let's check out the formula for LCM 😉:
e.g LCM of 12,15 is 60
Let's check out how:
divisors of 12=1,2,3,4,6,12
divisors of 15=1,2,3,5,15
greatest common divisor=3
LCM(12,15)=(12*15)/(3)=60
HCF: HCF of two or more numbers is the highest common factor of the given numbers.
It means the greatest number which can divide the given numbers.
Let's check out the formula for HCF 😹ðŸ’:
1. First we'll find factors of both numbers.
2. Then we'll find highest common among them. As simple as that.
e.g HCF of 12,15 is 3
Lets check how:
factors of 12=1,2,3,4,6,12
factors of 15=1,2,3,5,15
common factor=1,2,3
Highest Common Factor=3
Python Code for HCF and LCM 👇
Why it is reversed(n2_divisors)?
ReplyDelete