Javatpoint Logo
Javatpoint Logo

Greek Euclid's Algorithm

Euclid's algorithm is a mathematical algorithm. This algorithm is typically used to find the GCD of two positive integers. This algorithm is named after the Greek mathematician Euclid.

What is a GCD?

The term GCD stands for the Greatest-Common-Divisor. The GCD is the greatest number that is a common denominator of given numbers. It is also known as the GCF or HCF. Where, GCF stands for the Greatest Common Factor, and HCF stands for the Highest Common Factor.

How to find two positive numbers GCD?

These are three important conditions for finding the GCD:

Let's take examples to understand these conditions.

Example 1: Find the GCD of the A = 0, and B = 1023.

Example 2: Find the GCD of the A = 120, and B = 0.

Example 3: Find the GCD of the A = 30, and B = 18.

Example 4: Find the GCD of the A = 270, and B = 192.

Algorithm of GCD

Program

Output:


Greek Euclid's Algorithm





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA