title: The number of Fibonacci numbers lesser than a given n
body: <pre><code>#include &lt;stdio.h&gt;
  
  int fibonacci(int n) {
      int count, n1 = 0, n2 = 1, fib = 0;
      printf("Given number: ");
      scanf("%d", &amp;n);
      count = 0;
      while (count &lt; n) {
          fib = n1 + n2;
          n1 = n2;
          n2 = fib;
          ++count;
          if (n &gt; fib)
              printf("%d ", fib);
      }
      return 0;
  }
  
  int main() {
      int szam;
      fibonacci(szam);
      return 0;
  }
  </code></pre>
  
  <p>I've gotten this far, I just don't know how to count the numbers.
  for example:
  <br>input: <code>10</code>
  <br>output: <code>1 2 3 5 8</code></p>
  
  <p>but it should be:
  <br>in: <code>10</code>
  <br>out: <code>5</code></p>