public static void main(String[] args) {
		
		int a, b, holding;
		Scanner input = new Scanner(System.in);

		for(;;) {
			
			System.out.print("Please enter two integer parameters (0 to exit): ");
			a = input.nextInt();
			b = input.nextInt();
			
			if (a < b) {
				
				//rearranging the values such that a is always bigger than b
				holding = a;
				a = b;
				b = holding;
				
			} else if (a == 0 && b == 0) {
				
				//terminal values
				break;
			}
			
			//pass the two integers to the gcd method
			System.out.println("The GCD of values " + a + " and " + b + " is " + gcd(a,b) +".");
			
		}
		
		input.close();
		
	}