title: Loops with no body,i got the code from a book but i dont understand the math in the code
body: <pre class="lang-java prettyprint-override"><code>public class Main {
  
      public static void main(String[] args) throws IOException {
          int i;
          int sum=0;
  
          for(i=1;i&lt;=5;sum+=i++)
              System.out.println(sum);
      }
      ...
  }
  </code></pre>
  
  <p><strong>Actual Output:</strong><code>15</code></p>
  
  <p>I don't know how it did the math?</p>