In mathematics, the greatest common divisor (gcd) of two or more integers, when at least one of them is not zero, is the largest positive integer that divides the numbers without a remainder. For example, the GCD of 8 and 12 is 4. One good way to find the least common multiple of 2 numbers is to multiply both numbers by 1,2,3,4,5… and then find the first multiple that appears in both lists. The first number that appears in both lists is 24. (48 appears also, but it is not ‘least’), so 24 is the LCM of 6 and 8.
The post How to find the GCD of a number in recursive and non-recursive methods appeared first on Coding Security.
How to find the GCD of a number in recursive and non-recursive methods
read more
Tidak ada komentar:
Posting Komentar