title: Fibonacci sequence while loop
body: <p>I have to write code that displays the Fibonacci sequence to the user desired number of terms and must also use a while loop. I'm not sure why this code isn't working. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  int main (void) {
      int max;
      printf("Enter the max term of the Fibonacci Sequence:\n");
      scanf("%i", &amp;max);
      int a=0;
      int b=0;
      a=2;
  
      while(a&lt;max) {
          if((a==0||a==1))
          {
              printf("%i\n", &amp;a);
              ++a;
          }
          else if(a&gt;1)
          {
              a=(a-1)+(a-2);
              printf("%i\n", &amp;a);
              ++a;
          }
      }
      return 0;
  }
  </code></pre>