Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. public class Fibonacci {
  2.  
  3. public static void main (String args[]) {
  4.  
  5. //Fibonacciho sekvence - posloupnost. Kazde cislo je souctem dvou predchozich.
  6.  
  7. double k =0;
  8. double a = 1;
  9. double b = 1;
  10. while (k <= 20)
  11. {
  12. k = a + b;
  13. System.out.print(k + " ");
  14. a=b;
  15. b=k;
  16. }
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement