Fahad/MCG-CS/Code/Fibonaci.kcl
changeset 45 7545b1bc1514
equal deleted inserted replaced
44:a751aa1ee4f7 45:7545b1bc1514
       
     1 var fib = 0;
       
     2 print "Enter a number to calculate fibonaci";
       
     3 read fib;
       
     4 fib = fib + 1;
       
     5 
       
     6 var a = 0;
       
     7 var b = 1;
       
     8 
       
     9 var i = 0;
       
    10 for i = 0 to fib do
       
    11 	var temp = a;
       
    12 	a = b;
       
    13 	b = temp + b;
       
    14 end;
       
    15 
       
    16 print "The result is:";
       
    17 print b;
       
    18 
       
    19 read b;