Math, asked by ganesh8596, 11 months ago

write any two three digit numbers find their LCM and gcd by prime factorization method​

Answers

Answered by tripathiakshita48
0

Answer:

Pythom program for two three digit numbers find their LCM and gcd by prime factorization method​.

Step-by-step explanation:

In arithmetic, the LCM or least common multiple of two numbers a and b, is denoted as LCM (a,b) is the smallest or least positive integer that is divisible by both a and b.

LCM is also called the Least Common Divisor

  1. First, list down first few multiples of A and B.
  2. Mark the common multiples from the multiples of both numbers.
  3. Select the smallest marked common multiple. Hence, this results in the LCM(A, B).

The Highest Common Factor (HCF) of two numbers is the highest possible number that divides both the numbers completely. The Highest Common Factor (HCF) is also known as the Greatest Common Divisor (GCD).

H.C.F. is also called the greatest common factor (GCF).

                                     Program

def compute_lcm(x, y):

  if x > y:

      greater = x

  else:

      greater = y

  while(True):

      if((greater % x == 0) and (greater % y == 0)):

          lcm = greater

          break

      greater += 1

  return lcm

num1 = 54

num2 = 24

print("The L.C.M. is", compute_lcm(num1, num2))

For more related question : https://brainly.in/question/6142897

#SPJ1

Similar questions