progs/app9.while
changeset 93 4794759139ea
equal deleted inserted replaced
92:e85600529ca5 93:4794759139ea
       
     1 /* Fibonacci Program
       
     2    input: n
       
     3  */
       
     4 
       
     5 n := 19;
       
     6 minus1 := 0;
       
     7 minus2 := 1;
       
     8 while n > 0 do  {
       
     9        temp := minus2;
       
    10        minus2 := minus1 + minus2;
       
    11        minus1 := temp;
       
    12        n := n - 1
       
    13 };
       
    14 write minus2
       
    15