progs/fib.while
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Fri, 25 Oct 2013 17:55:35 +0100
changeset 154 51d6b8b828c4
parent 147 4725bba8ef26
child 178 d36363d648e3
permissions -rw-r--r--
added

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