/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rwl.euclidian.algorithm;

/**
 *
 * @author RainWhileLoop
 */
public class Euclidian {

    /**
     * Calculated the GCD of 2 numbers by using Euclidian Algorithm
     * @param num1 must not be 0
     * @param num2 must not be 0
     * @return GCD - greatest common divisor
     */
    public static int findGCD(int num1, int num2) {
        if (num1 == 0 || num2 == 0) {
            throw new ArithmeticException("Number must not zero!!!");
        }
        int dividend = Math.max(num1, num2);
        int divisor = Math.min(num1, num2);

        int fraction = dividend % divisor;
        
        if (fraction != 0) {
            return findGCD(divisor, fraction);
        }
        return divisor;
    }

}

@@ -354,16 +354,23 @@
 gorithm%0A
+     *%0A
      * @
@@ -386,32 +386,32 @@
 1 must not be 0%0A
-
      * @param nu
@@ -557,93 +557,95 @@
 == 0
- %7C%7C num2 == 0) %7B%0A            throw new ArithmeticException(%22Number must not zero!!!%22)
+) %7B%0A            return num2;%0A        %7D%0A        if (num2 == 0) %7B%0A            return num1
 ;%0A  
@@ -644,32 +644,33 @@
 num1;%0A        %7D%0A
+%0A
         int divi
@@ -790,17 +790,9 @@
 or;%0A
-        
 %0A
+
     
@@ -904,10 +904,158 @@
 %0A    %7D%0A%0A
+    private static void showProcess(int max, int min) %7B%0A        System.out.println(max + %22 = %22 + min + %22(%22 + max / min + %22) + %22 + max %25 min);%0A    %7D%0A
 %7D%0A

edit the initial condition