title: How to print out the GCD in different format
body: <p>I am trying to ask the user to enter two integers and have the message to say
  "The GCD of "first integer" and "second integer" is "GCD"</p>
  
  <p>I have all my calculations right but it is just printing out my num1 for all values. </p>
  
  <pre><code>import java.util.Scanner;
  
  
  public class Assignment3
  {
  
      public static void main(String[] args)
  
      {
  
          Scanner scan = new Scanner(System.in);
  
          System.out.print("Enter the first integer: ");
          int num1 = scan.nextInt();
  
          System.out.print("Enter the second integer: ");
          int num2 = scan.nextInt();
  
          while (num1 != num2)
          {
              if (num1&gt; num2)
              num1 = num1 - num2;
              else
              num2 = num2 - num1;
  
  
              }
  
  
          System.out.println("The gcd of" + num1 + " and " + num2 + " is " + num1);
  
      }
  
  
  }
  </code></pre>