Open In App

Greatest Common Divisor - GCD

Last Updated : 14 May, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

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 12 and 18 is 6, 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)

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 6

30 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.

GCD for Aptitude Preparation

Prepare for aptitude exams with shortcut methods, solved examples, and common GCD-related questions.

GCD Practice Questions

Practice GCD problems of varying difficulty, including MCQs to test and improve your problem-solving skills.

GCD for Programmers

Learn how to solve GCD-related problems using code, from basic programs to competitive programming challenges.


Next Article

Similar Reads

  翻译: