Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Fibonacci {
- public static void main (String args[]) {
- //Fibonacciho sekvence - posloupnost. Kazde cislo je souctem dvou predchozich.
- double k =0;
- double a = 1;
- double b = 1;
- while (k <= 20)
- {
- k = a + b;
- System.out.print(k + " ");
- a=b;
- b=k;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement