Difference between revisions of "Fibonacci sequence"
From CompSciWiki
Line 13: | Line 13: | ||
"The 5th number of the fibonacci sequence is 5."<br/> | "The 5th number of the fibonacci sequence is 5."<br/> | ||
<br/> | <br/> | ||
− | + | You may assume that the user always enters correct intenger format.<br/> | |
|SolutionCode=public class Fibonacci | |SolutionCode=public class Fibonacci |
Revision as of 22:55, 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 | |
---|---|---|
Solutionpublic class Fibonacci { public static void main(String[] args) { int answer = 0; for(int n = 1; n < 11; n++) { if(n == 0 | ||
Code |