diff --git a/.idea/misc.xml b/.idea/misc.xml index d15472f..116ab47 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/src/MyMath.java b/src/MyMath.java index 7da9a29..c1286f0 100644 --- a/src/MyMath.java +++ b/src/MyMath.java @@ -1,7 +1,23 @@ import java.util.Scanner; public class MyMath { + public static Scanner scanner = new Scanner(System.in); + public static void gcf() { + System.out.println("Give First Number: "); + int a = scanner.nextInt(); + System.out.println("Give Second Number: "); + int b = scanner.nextInt(); + int c; + while (b != 0) { + c = a; + a = b; + b = c % a; + } + + System.out.println("GCF is: " + a); + } public static void main(String[] args) { + gcf(); } }