Created
May 12, 2015 15:58
-
-
Save MrBean83/f05dd983c55dbb47451c to your computer and use it in GitHub Desktop.
Revisions
-
MrBean83 created this gist
May 12, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ public class Fibonacci { public static void main(String args[]) { // Declare variables int index = 0, first = 0, second = 1; System.out.println("Fibonacci Sequence"); System.out.println(); // Using a WHILE loop for this program. while (index < 21) { int next = first + second; System.out.println("Fib " + index + " = " + second); first = second; second = next; index++; } // end while } // end main } // end class