Conditionals: The GCD

The GCD
Write a program GCD_YI.java that finds the greatest common divisor of two integers using the Euclidean Algorithm:

if x > y, then if y divides x, the gcd of x and y is y; otherwise, the gcd of x and y is the same as the gcd of x % y and y

On paper do an example (it can be the one from Khan Academy) but showing all the mathematical step but thinking the way you would write it as a program.

screen-shot-2016-10-17-at-12-02-56-pm