progs/fib.while
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 22 Oct 2013 23:17:53 +0100
changeset 147 4725bba8ef26
parent 93 4794759139ea
child 178 d36363d648e3
permissions -rw-r--r--
added slides

write "Input a number ";
read n;
x := 0;
y := 1;
while n > 0 do {
  temp := y;
  y := x + y;
  x := temp;
  n := n - 1
};
write "Result ";
write y