My instructions were to write a program that displays the first 20 elements of the Fibonacci series, that begins with 0, 1, then the next numbers come from adding the preceeding two numbers.
0, 1, 1, 2, 3, 5, 8...

Here is what I have so far:

#include <stdio.h>

int main(void)
{
int current, prev = 1, prevprev = 0;
for (int i = 0; i < 20 i++)
{current = prev + prevprev;
printf(current + " ");
prevprev = prev;
prev = current;
}
println();
}
}

Also part of my instructions (i'm not sure if how to do this part either) are that I only display 5 members of the series per line, then start a new line, and they must be dspaced neatly in 5 columns across the screen, and display some appropriate title...boy these instructors are neat freaks!

thanks for you time and help,
-James

2. This will calculate your numbers. You'll have to do the screen formatting yourself
Code:
```#include <stdio.h>

int main ()
{
int bob [2];
printf("%d\n",0);
bob [0] = 1;
bob [1] = 2;
int mem;
printf("%d\n%d\n",bob[0],bob[1]);
for (int i=0;i<=16;i++) {
mem = bob[1];
bob [1] += bob[0];
printf("%d\n",bob[1]);
bob [0] = mem;
}
}```

3. The Fibonacci series is defined as:

Fib (0) = 0
Fib (1) = 1
Fib (n) = Fib (n-1) + Fib (n-2)

This could be implemented like this:

Code:
```int fib [N];
int i;

/* Print first N Fibonacci numbers */
for (i = 0; i < N; i++)
{
if (i == 0)
{
fib [i] = 0;
}
else if (i == 1)
{
fib [i] = 1;
}
else
{
fib [i] = fib [i - 1] + fib [i - 2];
}
}

/* Print them nice */
for (i = 0; i < N; i++)
{
if (i % 5 == 0)
{
printf ("\n");
}

printf ("%d\t", i, fib [i]);
}```

4. It could be implemented as a recursive function also. But for larger numbers this would not be feasible. Shiro's method demonstrates the algorithm but takes up memory if you print out too many elements.

You and crag have the right idea. You can accomplish printing and calculating fib values using only 2 variables. Perhaps illustrating this will give you an idea how to implement this:
Code:
```var1  var2
----  ----
0       1         <---- initial values
1       2
3       5
8       13```
I think you can see the pattern now.

5. Another way is to do this
phi = 1/2(1 + sqrt(5))
fib(n) = round((phi^n)/sqrt(5))
You can try this on your calculator.

6. Yup. The Golden Ratio!