Tag Archive | common gcd

Find commong GCD for two numbers using recursion.

This is a simple program. Pasting it below. public class FindGCD {     public static void main (String s[]) {         System.out.println(gcd(48, 24));     }     public static int gcd (int x, int y) {         if (x > y) {             return findGcd (x, y);         } else {             return findGcd (y,x);         }     }     private static int findGcd (int l, int […]