45
|
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; |