title: How to print a 2D array with random numbers
body: <p>I am trying to write a program that prints a 2d array with random numbers ranging from 100-10000 and prints out the max number in the array,average,and min. The program will ask the user for the number of rows and column and print random numbers in that array.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Random rand = new Random();
  
  int randomnumber = rand.nextInt(9901) + 100;
  
  Scanner console = new Scanner(System.in);
  
  System.out.println("Enter row");
  int n = console.nextInt();
  
  System.out.println("Enter column");
  int y = console.nextInt();
  
  int[][] array = new int[n][y];
  array[n][y] = randomnumber;
  
  int k;
  for (int i = 0; i &lt;= array.length; i++) {
      for (k = 0; k &lt;= array[i].length; k++) {
          System.out.print(array[i][k]);
      }
  }
  </code></pre>