title: ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3
body: <p>I am getting an exception and i don´t understand why</p>
  
  <pre><code>public static void main(String[] args) {
  
      Scanner input = new Scanner(System.in);
  
      int n = 3;
      int[] numbers = new int[n];
      float total = 0;
  
  
      for (int i = 1; i &lt;= 3; i++) {
  
          System.out.println("Please type the number " + i + ":");
          numbers[i] = input.nextInt();
  
          total = total + numbers[i];
  
      }
  
  
      System.out.println("The average of the 3 number is: " + total / n);
  }
  </code></pre>
  
  <p>Console: </p>
  
  <pre><code>Please type the number 1:
  3
  Please type the number 2:
  4
  Please type the number 3:
  5
  Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3
      at Ejercicio12.main(Ejercicio12.java:17)
  </code></pre>