gmen712

Finbonacci Sequence

Jan 14th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. public class FibonacciSequence {
  2.     public static void main(String args[]) throws InterruptedException {
  3.     int fib1 = 1, fib2 = 1;
  4.     while (fib1 + fib2 < 1000){
  5.     fib1 = fib1 + fib2;
  6.     System.out.println(fib1);
  7.         Thread.sleep(1000);
  8.     fib2 = fib1 + fib2;
  9.     System.out.println(fib2);
  10.         Thread.sleep(1000);
  11.     }
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment