cwtests/cw02/fib.while
changeset 833 aad5957eb7e4
child 853 568671822d52
equal deleted inserted replaced
832:a6e9fc38ae54 833:aad5957eb7e4
       
     1 write "Fib";
       
     2 read n;  
       
     3 minus1 := 0;
       
     4 minus2 := 1;
       
     5 while n > 0 do {
       
     6        temp := minus2;
       
     7        minus2 := minus1 + minus2;
       
     8        minus1 := temp;
       
     9        n := n - 1
       
    10 };
       
    11 write "Result";
       
    12 write minus2 
       
    13