progs/fib.while
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Fri, 29 Nov 2013 09:01:08 +0000
changeset 211 deece8c6cf3a
parent 208 bd5a8a6b3871
child 215 828303e8e4af
permissions -rw-r--r--
added

/* Fibonacci Program
   input: n
*/
write "Fib";
read n;
//n := 19;
minus1 := 0;
minus2 := 1;
while n > 0 do {
       temp := minus2;
       minus2 := minus1 + minus2;
       minus1 := temp;
       n := n - 1
};
write "Result";
write minus2