Difference between revisions of "Fibonacci sequence"
From CompSciWiki
Line 4: | Line 4: | ||
|Problem=Write a complete Java program Fibonacci that:<br/> | |Problem=Write a complete Java program Fibonacci that:<br/> | ||
− | *prompts the 10th fibonacci numbers using ''FOR'' loop(i.e. F(10))<br/> | + | *prompts the 10th fibonacci numbers using ''FOR'' loop (i.e. F(10))<br/> |
*prints out the 10th fibonacci number, using System.out.println<br/> | *prints out the 10th fibonacci number, using System.out.println<br/> | ||
<br/> | <br/> |
Revision as of 22:38, 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 |