title: How do I get the max and min values from a set of numbers entered?
body: <p>Below is what I have so far:</p>
  
  <p>I don't know how to exclude 0 as a min number though. The assignment asks for 0 to be the exit number so I need to have the lowest number other than 0 appear in the min string. Any ideas?</p>
  
  <pre><code>int min, max;
  
  Scanner s = new Scanner(System.in);
  System.out.print("Enter a Value: ");
  int val = s.nextInt();
  min = max = val;
  
  while (val != 0) {
    System.out.print("Enter a Value: ");
    val = s.nextInt();
    if (val &lt; min) {
        min = val;
    }
    if (val &gt; max) {
       max = val;
    }
  };
  System.out.println("Min: " + min);
  System.out.println("Max: " + max);
  </code></pre>