Fahad/MCG-CS/Code/Fibonaci.kcl
author Chengsong
Thu, 29 Jun 2023 04:17:48 +0100
changeset 653 bc5571c38d1f
parent 45 7545b1bc1514
permissions -rw-r--r--
more updates in section 4.2 and incorporating Christian comments

var fib = 0;
print "Enter a number to calculate fibonaci";
read fib;
fib = fib + 1;

var a = 0;
var b = 1;

var i = 0;
for i = 0 to fib do
	var temp = a;
	a = b;
	b = temp + b;
end;

print "The result is:";
print b;

read b;