title: Adding values in a for loop
body: <p>I cant figure out how to add the values after it spits out the numbers.
  it says:</p>
  
  <blockquote>
    <p>Number: 5 // I typed 5<br>
    1 2 3 4 5<br>
    The sum is.</p>
  </blockquote>
  
  <p>So i need to add those number 1 2 3 4 5 but cant figure out how.</p>
  
  <pre><code> import java.util.Scanner
   public class AddingValuesWithAForLoop
   {
        public static void main( String[] args )
        {
            Scanner keyboard = new Scanner(System.in);
            System.out.println( " \n" );
  
            System.out.println( "Number: " );
            int number = keyboard.nextInt();
            int sum = 0;
  
            for (int run=1; run&lt;=number; run=run+1)
            {
                System.out.print( run + " " );
                sum = sum + 1 ;
            }
  
            System.out.println( "The sum is . " );
       }
   }
  </code></pre>