title: Printing Fibonacci numbers up to n in C
body: <p>The following code uses a user define function to print fibonacci numbers up to the user's choosing. The only problem is that the output includes the first n fibonacci numbers, followed by a zero. (e.g. 1,1,2,3,5,8,0) How can I get rid of the zero?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int fibonacci(int a);
  int main()
  {
      int j, number;
      printf("Enter the number of terms: ");
      scanf("%d", &amp;number);
      printf("Fibonacci Series: ");
      j = fibonacci(number);
      printf("%d", j);
  }
  
  int fibonacci (int a)
  {
      int num1 = 1, num2 = 1, k, i;
      for (i = 1; i &lt;= a; ++i)
      {
          printf("%d, ", num1);
          k = num1 + num2;
          num1 = num2;
          num2 = k;
      }
      return 0;
  }
  </code></pre>