title: How to find the smallest and largest element in an array of random integers?
body: <p>Hi guys I'm writing a program to do the thing below. I can't figure out how to write it. I've only figured out how to do generate the random ints but other than that I'm completely lost. I would love it if you guys help me!
  program that creates an array of size 10, and fills it with random integers between 1 and 100.  The program then outputs the largest and the smallest integers in the array.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>public class LargestSmallest
  {
      public static void main (String [] args)
      {
          int [] number = new int [2];
          System.out.println ("The random numbers generated are: ");
          for (int count =0; count &lt; number.length ; count++)
          {
              number[count] = (int)(Math.random()*100+1);
              System.out.println (number[count]);
          }
      }
  }
  </code></pre>