title: How to display the highest and lowest numbers input by the user?
body: <p>The program asks the user to input any amount of people they want. The program will then ask for the height of each person (not in feet, just in whole numbers like 5, 7, 10, etc.). The program then displays the average height of all those people as well as the tallest and shortest height out of those people.</p>
  
  <p>The average height part works but my problem is trying to display the tallest height entered and shortest height entered.</p>
  
  <pre><code>package loop2;
  
  import java.io.Reader;
  import java.text.DecimalFormat;
  import java.util.Random;
  import java.util.Scanner;
  
  public class PgmTemplate {
  
     public static void main(String[] args) {
         Scanner input =new Scanner(System.in);
          int sum =0;
          int number=0, n;
          int average = 0;
          int highest= 0;
          int lowest= 0;
          lowest = number;
          System.out.println("enter the number of people");
          n = input.nextInt();
          for(int i = 0; i &lt; n; i++) {
              System.out.println("enter the height of each person");
              number = input.nextInt();
              sum += number;
              average = sum / n;
          }
          if(number &gt; highest) {
              highest = number;
          }else if(number &lt; lowest) {
              lowest = number;
          }
          System.out.println("the average height is "+ average);
          System.out.println("the tallest person is " + highest);
          System.out.println("the shortest person is " + lowest);
      }
  }
  </code></pre>