diff --git a/.idea/misc.xml b/.idea/misc.xml index d15472f..69ace3f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/MyMath.java b/src/MyMath.java index 7da9a29..e956260 100644 --- a/src/MyMath.java +++ b/src/MyMath.java @@ -1,7 +1,28 @@ import java.util.Scanner; +/** + * @author Trevor Hartman + * @author MJ Fracess + * @since Version 1.0 + */ public class MyMath { + private final static Scanner s = new Scanner(System.in); + public static void gcf (){ + System.out.println("Enter your first number to find the greatest common factor:"); + int a = s.nextInt(); + + System.out.println("Enter your second number to find the greatest common factor:"); + int b = s.nextInt(); + + while (b!= 0){ + int c = a; + a=b; + b = c % b; + } + System.out.printf("The Greatest Common Factor is: %d", a); + } public static void main(String[] args) { + gcf(); } }