title: Cannot get correct max and min values of user inputs
body: <p>I am writing a method that takes user integer inputs and display the Total, Average, Maximum and Minimum.</p>
  
  <p>I have the total and average working but I am getting 2147483647 for the max and -2147483648 for the minimum.</p>
  
  <p>The loop must only end when the user inputs -1.</p>
  
  <p>My code:</p>
  
  <pre><code>public static void processNumbers()
  {
      Menu m = new Menu();
      clrscr();
  
      int count = 0; // Number of times a value has been added
      int num = 0; // The Integer that the user inputs
      int tot = 0; // The total sum of the inputs
      int avg = 0; // The average value of the inputs
      int max = Integer.MAX_VALUE; // The maximum value of the inputs
      int min = Integer.MIN_VALUE; // The minimum value of the inputs
  
      System.out.println ("Please enter a whole number (e.g. 150)");
  
      while ((num = Genio.getInteger()) != -1)
      {
          count ++;
  
          tot += num;
          avg = tot / count; //Calculate the average the while loop
          if(tot&gt;max) max = tot;
          if(tot&lt;min) min = tot;
  
          System.out.println("Total \t Average\t Maximum\t Minimum\n");
          System.out.println(tot + "\t" + avg + "\t\t" + max + "\t" + min + "\n");
      }
      clrscr();
      System.out.println("You entered -1, you will now return to the menu!");
      pressKey();
      m.processUserChoices();
  }
  </code></pre>