This is my attempt at the Euclid Algorithm. I would like it if someone could give me some pointers on how to fix this so that it would work. It compiles fine.
import java.util.Scanner;
public class Euclid{
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
System.out.print("Enter the first number: ");
int n = scanner.nextInt();
System.out.print("Enter the second number: ");
int m = scanner.nextInt();
int remain=m%n;
int remain2=n%remain;
while(remain2>0){
remain=remain%remain2;
}
System.out.print("The GCF is: "+ remain);
}
}