Fibonacci sequence: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 1,731: | Line 1,731: | ||
121393 121393</pre> |
121393 121393</pre> |
||
==={{header|bootBASIC}}=== |
==={{header|bootBASIC}}=== |
||
Variables in bootBASIC are 2 byte unsigned integers that roll over if there is an overflow. Entering a number greater than 24 will result in an incorrect outcome. |
|||
<syntaxhighlight lang="BASIC"> |
|||
10 print "Enter a "; |
|||
20 print "number "; |
|||
30 print "greater "; |
|||
40 print "than 1"; |
|||
50 print " and less"; |
|||
60 print " than 25"; |
|||
70 input z |
|||
80 b=1 |
|||
90 a=0 |
|||
100 n=2 |
|||
110 f=a+b |
|||
120 a=b |
|||
130 b=f |
|||
140 n=n+1 |
|||
150 if n-z-1 goto 110 |
|||
160 print "The "; |
|||
170 print z ; |
|||
180 print "th "; |
|||
190 print "Fibonacci "; |
|||
200 print "Number is "; |
|||
210 print f |
|||
</syntaxhighlight> |
|||
==={{header|Chipmunk Basic}}=== |
==={{header|Chipmunk Basic}}=== |