Created
February 23, 2016 23:44
-
-
Save thmain/f3b6b4056080ef76cdd4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ElucidGCD { | |
public static int findGCD(int number1, int number2) { | |
// base case | |
if (number2 == 0) { | |
return number1; | |
} | |
return findGCD(number2, number1 % number2); | |
} | |
public static void main(String[] args) { | |
System.out.println(findGCD(156, 282)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment