Skip to content

Instantly share code, notes, and snippets.

@thmain
Created February 23, 2016 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thmain/f3b6b4056080ef76cdd4 to your computer and use it in GitHub Desktop.
Save thmain/f3b6b4056080ef76cdd4 to your computer and use it in GitHub Desktop.
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