Greatest Common Divisor - GCD
The Greatest Common Divisor (GCD) also known as the Highest Common Factor (HCF) is the greatest number that divides a set of numbers without leaving a remainder. For example: GCD of 4 and 6 is 2, as it divides both numbers and is the largest of all their factors.
The GCD of any two numbers is never negative or 0, and the least positive integer common to any two numbers is always 1.
Examples of GCD (Greatest Common Divisor)
Here are some example of GCD of Two Numbers:
12 and 18:
Divisors of 12 are 1, 2, 3, 4, 6 and 12
Divisors of 18 are 1, 2, 3, 6, 9 and 18
The common Divisors are 1, 2, 3 and 6. The greatest common divisor or GCD is 630 and 15:
Divisors of 30 are 1, 2, 3, 5, 15 and 30
Divisors of 15 are 1, 3, 5 and 15
The common Divisors are 1, 3, 5 and 15. The greatest common divisor or GCD is 15.4 and 9:
Divisors of 4 are 1, 2 and 4
Divisors of 9 are 1, 3 and 9
There is only one common divisor 1. Hence GCD is 1.
GCD for Beginners
This section covers the basics of GCD, different methods to find it, its properties, and real-life uses explained in a simple way.
- How to find GCD (Greatest Common Divisor)?
- How to find the GCD of more than 2 numbers
- Relation between GCD and LCM
- Properties of GCD
- Euclid Division Lemma
- Euclidean Algorithm
- Extended Euclidean Algorithm
- Applications of GCD in Real Life
- Tips and Tricks to Find GCD (Greatest Common Divisor)
- GCD Calculator
GCD for Aptitude Preparation
Prepare for aptitude exams with shortcut methods, solved examples, and common GCD-related questions.
- Short Tricks to Solve GCD with Solved Examples
- Interesting Facts about GCD
- HCF / GCD and LCM – Aptitude Questions & Answers
GCD Practice Questions
Practice GCD problems of varying difficulty, including MCQs to test and improve your problem-solving skills.
- GCD Practice Questions (Easy Level)
- GCD Practice Questions (Medium Level)
- GCD Practice Questions (Hard Level)
- MCQs on GCD
GCD for Programmers
Learn how to solve GCD-related problems using code, from basic programs to competitive programming challenges.
- Program for GCD of Two Numbers
- GCD of an array
- Add two fractions
- Check for Co-Prime
- Water Jug Problem
- GCD Practice Problems for Competitive Programming
- GCD Coding Problems
Commonly Asked Questions on GCD
Are GCD and HCF the same?
Yes, both describe the largest number that divides two or more numbers without leaving a remainder.
Are GCD and LCM the same?
No, LCM stands for least common multiple. LCM of two numbers is smaller value that is divisible by both the two numbers. Whereas GCD is the highest common factor of two numbers, that can divide the two numbers evenly. Therefore, LCM and GCD are different.
How is GCD Calculated?
GCD of two numbers can be calculated using different methods listed in the article, and the GCD can also be calculated by using the LCM of the two numbers. The formula to calculate GCD using LCM is expressed as GCD (a, b) = (a × b)/ LCM (a, b). This means if we know the two numbers and their LCM, we can easily find their GCD using this formula.
Can the Greatest Common Divisor be Negative?
No, the greatest common divisor cannot be negative as it represents the greatest common divisor of two positive integers. The least value of GCD can be 1 and not lesser than it. This proves the point that GCD cannot hold a negative value.
What is the GCD of 24 and 36?
GCD of 24 and 36 is 2 × 2 × 3 = 12.
What is the GCD of 36 and 72?
There are 9 common factors of 36 and 72, that are 1, 2, 3, 4, 36, 6, 9, 12, and 18. Therefore, the gcd of 36 and 72 is 36.