cwtests/cw04/fib.while
changeset 859 f766d3486c9d
parent 852 8706b846a3e0
--- a/cwtests/cw04/fib.while	Sat Dec 04 00:13:20 2021 +0000
+++ b/cwtests/cw04/fib.while	Sat Dec 04 00:41:31 2021 +0000
@@ -1,12 +1,14 @@
-write "Fib";
-read n;
-minus1 := 0;
-minus2 := 1;
+write "Fib: ";
+read n;  
+minus1 := 1;
+minus2 := 0;
 while n > 0 do {
-  temp := minus2;
-  minus2 := minus1 + minus2;
-  minus1 := temp;
-  n := n - 1
+       temp := minus2;
+       minus2 := minus1 + minus2;
+       minus1 := temp;
+       n := n - 1
 };
-write "Result";
-write minus2
+write "Result: ";
+write minus2 ;
+write "\n"
+