**Note:** To compute a Fibonacci number at a certain position N, we have to loop through all previous numbers starting at position 0.

**Tip:** If you just want to list Fibonacci numbers, you could change Fibonacci() to simply use Console.WriteLine(a).

**And:** This would make the method print out each number as it is computed, which would reduce the total amount of computation required.

**Tip:** To solve this problem, you can change Fibonacci() to return double. Also change a, b, and temp to be of type double.

**Tip:** I tested the output of the program and it is correct. I usually try to post correct code.

**Quote:** Fibonacci began the sequence not with 0, 1, 1, 2, as modern mathematicians do but with 1, 1, 2.

© 2007-2020 Sam Allen. Every person is special and unique. Send bug reports to info@dotnetperls.com.

Home

Dot Net Perls