@@ -0,0 +1,1428 @@
+package thirty_days_of_code;%0D%0A%0D%0Aimport java.util.Scanner;%0D%0A%0D%0A/*%0D%0A * Problem Statement:%0D%0A * Euclid's Algorithm for Computing the GCD of two integers%0D%0A * %0D%0A * Given two integers, x and y, their GCD (greatest common divisor) can be%0D%0A * calculated recursively using Euclid's Algorithm, which essentially says that%0D%0A * if x equals y, then GCD(x,y)=x; otherwise, GCD(x,y)=GCD(x-y,y) if x%3Ey. Note%0D%0A * that this logic can be further optimized for a more efficient implementation.%0D%0A * %0D%0A * Given the starter code in your editor, complete the function body so it%0D%0A * returns the GCD of two input integers, x and y.%0D%0A * %0D%0A * Input Format: %0D%0A * Two space-separated integers, x and y.%0D%0A * %0D%0A * Constraints:%0D%0A * 1 %3C= x,y %3C= 106%0D%0A * %0D%0A * Output Format: %0D%0A * Print the GCD of x and y as an integer.%0D%0A * %0D%0A * Sample Input: %0D%0A * 1 5%0D%0A * %0D%0A * Sample Output: %0D%0A * 1%0D%0A */%0D%0Apublic class Recursion %7B%0D%0A%0D%0A    public static void main(String args%5B%5D) %7B%0D%0A        %0D%0A        Scanner sc=new Scanner(System.in);%0D%0A        int a = sc.nextInt();%0D%0A        int b = sc.nextInt();%0D%0A        %0D%0A        int gcd = find_gcd(a,b);%0D%0A        System.out.println(gcd);%0D%0A        sc.close();%0D%0A    %7D%0D%0A    %0D%0A    static  int find_gcd(int a, int b)%7B%0D%0A        %0D%0A        if (a == 0) %7B%0D%0A            return b;%0D%0A        %7D else if (b == 0) %7B%0D%0A            return a;%0D%0A        %7D else if (a %3E b) %7B%0D%0A            return find_gcd(b, a %25 b);%0D%0A        %7D%0D%0A        return find_gcd(a, b %25 a);%0D%0A    %7D%0D%0A%7D

Add Recursion