title: int returns garbage value
body: <p>I have a problem: my int returns too big of a value when my program is executed.
  This program counts the arithmetic average.</p>
  
  <p>For example: When I typing 1,2,3,4,5, it says <em>2293393</em>.</p>
  
  <pre><code>/* 
   * File:   main.cpp
   * Author: Natch
   *
   * Created on 4 listopad 2012, 15:32
   */
  
  #include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  /*
   * 
   */
  int main(int argc, char** argv) {
      int n,x;
      x = 0;
      /*
       * a - array
       * x - repeat
       * n - array fields
       * suma - array fields sum
       */
      cout &lt;&lt; "Srednia liczb" &lt;&lt; endl;
      cout &lt;&lt; "Program oblicza srednia z x liczb." &lt;&lt; endl;
      cout &lt;&lt; "Podaj ilosc liczb do obliczenia sredniej:" &lt;&lt; endl;
      cin &gt;&gt; n;
      int a[n];
  
      while(x&lt;n) {
          x++;
          cout &lt;&lt; "Podaj " &lt;&lt; x &lt;&lt; " liczbe:" &lt;&lt; endl;
          cin &gt;&gt; a[x];
      }
      long int suma;
  
      for (int i = 0; i &lt; n; i++) {
          suma += a[i];
      }
  
      int srednia = suma/n;
      cout &lt;&lt; "Srednia wynosi:" &lt;&lt; endl &lt;&lt; srednia &lt;&lt; endl;
      system("pause");
  
      return 0;
  }
  </code></pre>
  
  <p>Sorry for my English, I'm from Poland.</p>
  
  <p>You can translate couts in google translate(pl->en).</p>