title: Java program which sums numbers from 1 to 100
body: <p>I have been recently started learning Java and would want to make code that sums the numbers from 1 to 100 (result would be 5050)</p>
  <p>The code should go like 1+2+3+4+5+6+7+8+9+10... etc</p>
  <p>I have tested it with this code:</p>
  <pre><code>public class T35{
  
      public static void main(String[] args) {
          int nmb;
          
          for(nmb= 1; nmb&lt;= 100; nmb++){
            
              System.out.println(nmb);
              
          }
          
      }
      
  }
  </code></pre>
  <p>But the result is that it goes from 1 to 100 without adding the numbers.</p>
  <p>Not sure if it need to be made with <code>while</code> but could not figure the math for it.</p>