title: How can I make it so the random number is changed every time it prints?
body: <blockquote>
  <p>Write the code to ask the user for a positive integer n, then print 10 random integers from 1 to n inclusive using <code>Math.random()</code>.</p>
  </blockquote>
  <p>How do I make it so that the output is different every time? As of now every output following the first one is exactly the same.</p>
  <pre><code>/* Lesson 8 Coding Activity Question 1 */
  
  import java.util.Scanner;
  import edhesive.testing.Math;
  
  public class U2_L8_Activity_One{
    public static void main(String[] args){
  
      /* Write your code here */
    Scanner scan = new Scanner(System.in);
    
    System.out.println(&quot;Enter a positive integer.&quot;);
    int n = scan.nextInt();
  
    double ran = Math.random();
    int range = n;
    int min = 1;
    int answer = (int) (ran * range) + min;
    
    System.out.println(&quot;Printing 10 random integers from 1 to n...&quot;);
    System.out.println(answer);
    System.out.println(answer);
    System.out.println(answer);
    System.out.println(answer);
    System.out.println(answer);
    System.out.println(answer);
    System.out.println(answer);
    System.out.println(answer);
    System.out.println(answer);
    System.out.println(answer);
    }
  }
  </code></pre>