progs/fib.while
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Wed, 27 Nov 2013 21:36:30 +0000
changeset 208 bd5a8a6b3871
parent 207 f824e1331fc6
child 211 deece8c6cf3a
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