GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • Fundamentals & OOPs
  • Data structures and algorithms
  • Aptitude
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 27 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
AptitudeQuantitative aptitude · Numbers and Counting

LCM and HCF

HCF and LCM by prime factorisation and by division, the HCF × LCM identity, fractions, and the tile, bell, remainder and circular-track word problems that rest on them.

6 min read 45 questions
Practice questions
2²35

On this page

1/9
  1. 011. What these questions test
  2. 022. Prime-factorisation method
  3. 033. The division (short-division) method
  4. 044. HCF and LCM of fractions
  5. 055. Reading the word problem
  6. 066. Remainder problems
  7. 077. Common traps
  8. 088. Revision sheet
  9. 09Practice
Back to top

1. What these questions test

HCF and LCM questions are among the most common in placement tests, and almost every one is solved the same way: write each number as a product of primes, then read the answer off the factors. The HCF (highest common factor, also called GCD) of two or more numbers is the largest number that divides all of them. The LCM (lowest common multiple) is the smallest number that all of them divide.

The whole topic turns on one picture. If you split two numbers into primes and place the shared primes in the overlap of two circles, the overlap multiplies to the HCF and the whole diagram multiplies to the LCM.

3648322322
36 = 2² × 3² and 48 = 2⁴ × 3. Overlap = HCF = 12; everything = LCM = 144

A number is co-prime to another when they share no prime factor; then their HCF is 1 and their LCM is simply their product.

2. Prime-factorisation method

Write each number in prime powers. The HCF takes the lowest power of each prime they both have; the LCM takes the highest power of every prime that appears in either.

For 36 = 2² × 3² and 48 = 2⁴ × 3: the primes are 2 and 3. The lowest powers are 2² and 3, so HCF = 2² × 3 = 12. The highest powers are 2⁴ and 3², so LCM = 2⁴ × 3² = 144.

You wantRule
HCF (highest common factor)lowest power of each prime common to both
LCM (lowest common multiple)highest power of every prime that appears
For two numbersHCF × LCM = product of the numbers
Missing number(HCF × LCM) ÷ the known number
HCF of fractionsHCF of numerators ÷ LCM of denominators
LCM of fractionsLCM of numerators ÷ HCF of denominators

The two are tied together: HCF × LCM = the product of the numbers (for two numbers only). Here 12 × 144 = 1728 = 36 × 48. So if you know the HCF, the LCM and one number, the other is (HCF × LCM) ÷ (known number).

3. The division (short-division) method

When factorising is slow, use the ladder. For the HCF, keep dividing both numbers by a prime that goes into both; stop when none does. The HCF is the product down the left. Dividing 48 and 72: the common primes are 2, 2, 2 and 3, so HCF = 2 × 2 × 2 × 3 = 24.

24872224362121836923
Dividing 48 and 72 by their common primes: HCF = 24

For the LCM, divide by a prime that goes into at least two of the numbers, carrying the others down unchanged, until no prime divides two of them. The LCM multiplies the left column by the bottom row. For 12, 18 and 30 the left column is 2 and 3 and the bottom row is 2, 3 and 5, so LCM = 180.

212183036915235
Short division of 12, 18 and 30: LCM = 180

Euclid gives the HCF even faster: divide the larger by the smaller, then the divisor by the remainder, and so on; the last non-zero remainder is the HCF. HCF(1001, 910): 1001 = 910 + 91, 910 = 91 × 10, so the HCF is 91.

4. HCF and LCM of fractions

Fractions have their own rule, and it is easy to remember if you notice it is the "opposite way round" top and bottom:

  • HCF of fractions = HCF of the numerators ÷ LCM of the denominators
  • LCM of fractions = LCM of the numerators ÷ HCF of the denominators

Put each fraction in lowest terms first. HCF of 2/3 and 4/9 = HCF(2, 4) ÷ LCM(3, 9) = 2/9 = 2/9. LCM of 3/4 and 5/6 = LCM(3, 5) ÷ HCF(4, 6) = 15/2 = 15/2.

Sanity check: the HCF of a set of fractions is never larger than the smallest fraction, and the LCM is never smaller than the largest. If yours is, you have swapped the numerator and denominator rules.

5. Reading the word problem

Most marks come from stories. The skill is deciding, in one read, whether the answer is an HCF or an LCM. "Largest / greatest / longest that fits exactly" means HCF. "Together again / smallest that each divides" means LCM.

The story asks forUseAnswer
largest tile / longest tape / greatest length that measures exactlyHCFHCF of the numbers
bells or lights together again / smallest number divisible by eachLCMLCM of the numbers
least number leaving the same remainder r each timeLCMLCM + r
least number whose remainders are each k short of the divisorLCMLCM − k
greatest number dividing several numbers with the same remainderHCFHCF of the differences
runners back together at the start of a circular trackLCMLCM of the lap times

Largest tile (HCF). The largest square tile paving a 180 cm by 150 cm floor has side HCF(180, 150) = 30 cm, needing 6 × 5 = 30 tiles.

180 cm150 cm
A 180 cm by 150 cm floor; the largest tile has side 30 cm

Bells / circular track (LCM). Bells ringing every 6, 8 and 12 seconds ring together every LCM(6, 8, 12) = 24 seconds; two runners lapping a track in those times meet at the start on the same multiples.

When each bell rings (seconds)Bell: 6 s0612182430Bell: 8 s081624Bell: 12 s01224
All three first coincide at 24 seconds

6. Remainder problems

Same remainder r, several divisors. If a number leaves the same remainder r when divided by a few numbers, then (number − r) is a common multiple of them, so the least such number is LCM + r. The least number leaving remainder 3 under 5, 6 and 8 is LCM(5, 6, 8) + 3 = 120 + 3 = 123.

Shortfall k. If each remainder is the same amount k short of its divisor (remainders 1, 2, 3 for divisors 4, 5, 6, each 3 short), then (number + k) is divisible by all of them, so the number is LCM − k = 60 − 3 = 57.

Same remainder, dividing several numbers. The greatest number that divides 61, 127 and 205 leaving the same remainder divides their differences: 127 − 61 = 66 and 205 − 127 = 78, and HCF(66, 78) = 6. Each of 61, 127, 205 then leaves 1.

7. Common traps

  • Swapping HCF and LCM. The HCF is the small one (it divides the numbers); the LCM is the big one (the numbers divide it). The HCF can never exceed the smallest number.
  • a × b is not the LCM unless a and b are co-prime. 6 × 8 = 48, but LCM(6, 8) = 24, because the shared factor 2 is counted twice in the product.
  • HCF × LCM = product holds for two numbers only, not for three or more.
  • Remainder problems: add r for "same remainder" (LCM + r) but subtract k for "same shortfall" (LCM − k) — the two look alike and are opposite.
  • Fractions: HCF uses HCF of numerators over LCM of denominators; do not mix them up.
  • "Together again": the LCM is the time until they next coincide, measured from the start, not the number of times they coincide.

8. Revision sheet

NeedRule
HCFlowest power of each common prime (or product of the left column in the ladder)
LCMhighest power of every prime present
Two numbersHCF × LCM = product
Missing number(HCF × LCM) ÷ known number
HCF of fractionsHCF(numerators) ÷ LCM(denominators)
LCM of fractionsLCM(numerators) ÷ HCF(denominators)
Largest tile / longest measureHCF of the lengths
Bells together / smallest common numberLCM of the numbers
Same remainder rLCM + r
Each remainder k shortLCM − k
Same remainder dividing several numbersHCF of the differences

When unsure, factorise. HCF, LCM, the missing-number identity and every word problem above are read straight off the prime factorisation.

Practice

45 questions in 3 sets. Every answer comes with its explanation, and each question you get right earns XP.

  • Easy · 15
  • Medium · 15
  • Hard · 15
Start practising
PreviousNumber SeriesNextSimplification and Approximation
Log inStart free