HowManyNumbers Logo

Greatest Common Divisor (GCD) of 118 and 40

The greatest common divisor (GCD) of 118 and 40 is 2.

What is the Greatest Common Divisor (GCD)?

The GCD of two integers is the largest positive integer that divides both numbers without leaving a remainder. It is useful in simplifying fractions, finding common factors, and in number theory.

How to Calculate the GCD of 118 and 40?

We use the Euclidean algorithm, which involves the following steps:

  1. Divide the larger number by the smaller number.
  2. Replace the larger number with the smaller number and the smaller number with the remainder from the division.
  3. Repeat this process until the remainder is zero.
  4. The non-zero remainder just before zero is the GCD.

Step-by-Step Euclidean Algorithm

StepCalculation
1 118 ÷ 40 = 2 remainder 38
2 40 ÷ 38 = 1 remainder 2
3 38 ÷ 2 = 19 remainder 0

Examples of GCD Calculations

NumbersGCD
31 and 1221
123 and 861
148 and 1244
181 and 1601
24 and 764

Try Calculating GCD of Other Numbers







Related Calculators