Difference between revisions of "Fibonacci sequence"
From CompSciWiki
Line 8: | Line 8: | ||
<br/> | <br/> | ||
Your output should look something like<br/> | Your output should look something like<br/> | ||
− | The 10th number of the fibonacci sequence is X. (where X should be the 10th number.)<br/> | + | "The 10th number of the fibonacci sequence is X". (where X should be the 10th number.)<br/> |
+ | <br/> | ||
+ | Note that the fibonacci sequence Xn = Xn-1 + Xn-2 <br/> | ||
+ | where: <br/> | ||
+ | *Xn is the term number "n", in this case n will be 10,<br/> | ||
+ | *Xn-1 is the previous term (n-1) which will be 9, and<br/> | ||
+ | *Xn-2 is the term before that (n-2) which will be 8.<br/> | ||
+ | |||
+ | |||
Revision as of 12:37, 1 April 2010
Back to the Program-A-Day homepage
ProblemWrite a complete Java program Fibonacci that:
|
...by students
An image or By Students section | |
---|---|---|
SolutionThe solution... | ||
Code |