title: How would one find the product of given numbers with a while loop?
body: <p>I am asked to do the follow question - </p>
  
  <p>Write a Java program that uses a while statement to prompt the user to enter 6 integer numbers.
  Your program should print the product of the numbers entered when the loop ends.</p>
  
  <pre><code>   Example output
     Product of four numbers
     Enter a number: 2
     Enter a number: 2
     Enter a number: 2
     Enter a number: 2
     Product equals 16
  </code></pre>
  
  <p>I've attempted the question with the following code: `</p>
  
  <pre><code>    //declaring variables
      int num1, num2, num3, num4, num5, num6, result;
  
      //prompting user
      Scanner scanner = new Scanner(System.in);
      System.out.print("Enter a number: ");
      num1 = scanner.nextInt();
  
      System.out.print("Enter a number: ");
      num2 = scanner.nextInt();
  
      System.out.print("Enter a number: ");
      num3 = scanner.nextInt();
  
      System.out.print("Enter a number: ");
      num4 = scanner.nextInt();
  
      System.out.print("Enter a number: ");
      num5 = scanner.nextInt();
  
      System.out.print("Enter a number: ");
      num6 = scanner.nextInt();
  
      //calculations
      result = num1*num2*num3*num4*num5*num6;
  
      //output
      System.out.println("The product of your numbers entered are: " + result);
  
  }
  </code></pre>
  
  <p>}`</p>
  
  <p>However I <strong>MUST</strong> use a while loop, how would I incorporate that?</p>