title: Storing Fibonacci numbers in an array (C)
body: <p>Can't get my program to output the correct number. I feel like I am making a simple mistake. This is written in C.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
     {
      int n, i;
      int list[n];
  
      while(1)
      {
         scanf("%d", &amp;n);
         if(n == -1)
      {
          break;
      }
      else
       {
          for(i = 2; i &lt; n; i++)
          {
              list[i] = list[i-1]+list[i-2]; 
          }
          printf("%d %d", i, list[i] );
      }
   }
  }
  </code></pre>