About 7,070 results
Open links in new tab
  1. Code for Greatest Common Divisor in Python - Stack Overflow

    Jun 24, 2012 · The greatest common divisor (GCD) of a and b is the largest number that divides both of them with no remainder. One way to find the GCD of two numbers is Euclid’s algorithm, which is …

  2. math - C# find the greatest common divisor - Stack Overflow

    "The greatest common divisor of two integers is the largest integer that evenly divides each of the two numbers. Write method Gcd that returns the greatest common divisor of two integers. Incorpora...

  3. algorithm - Python gcd for list - Stack Overflow

    Mar 22, 2015 · Since you call method Greatest_Common_Divisor recursively but without base case. Align print Greatest_Common_Divisor (A) and "def" in the same column and that problem would be …

  4. JS how to find the greatest common divisor - Stack Overflow

    I would like to find the greatest common divisor using JavaScript. Anyone done that before and willing to share?

  5. Java: get greatest common divisor - Stack Overflow

    Oct 24, 2010 · This method uses the Euclid’s algorithm to get the "Greatest Common Divisor" of two integers. It receives two integers and returns the gcd of them. just that easy!

  6. greatest common divisor - Finding the GCD without looping - R - Stack ...

    Feb 2, 2014 · gcd(x,y) //assuming x is the largest value //do r = x%y; x = y; y = r; //while r != 0; return x; After several searches on Google, SO and Youtube refreshing my memory of gcd algorithms, I …

  7. How to find greatest common divisor using recursive function in Python?

    Dec 2, 2019 · I am asked to find the greatest common divisor of integers x and y using a recursive function in Python. The condition says that: if y is equal to 0 then gcd (x,y) is x; otherwise gcd (x,y) is …

  8. Compute the greatest common divisor and least common multiple of …

    Nov 27, 2022 · Compute the greatest common divisor and least common multiple of two integers Asked 3 years ago Modified 1 year, 3 months ago Viewed 10k times

  9. c++ - greatest common factor function - Stack Overflow

    Apr 8, 2019 · Write a function which accepts x and y as input parameters and calculates and returns the greatest common denominator of both values. I tried making a function to find the GCD, and then just …

  10. How to write a simple Java program that finds the greatest common ...

    Here is the question: "Write a method named gcd that accepts two integers as parameters and returns the greatest common divisor of the two numbers. The greatest common divisor (GCD) of two integer...