Jump to content

Fibonacci sequence: Difference between revisions

Fibonacci sequence in Quite BASIC
(Added Chipmunk Basic and MSX Basic)
(Fibonacci sequence in Quite BASIC)
Line 2,614:
PRINT
'*****sample inputs*****</syntaxhighlight>
 
==={{header|Quite BASIC}}===
<syntaxhighlight lang="qbasic">100 CLS
110 rem The array F holds the Fibonacci numbers
120 ARRAY f : rem DIM f(22) para Quite BASIC and MSX-BASIC
130 LET f(0) = 0
140 LET f(1) = 1
150 LET n = 1
160 rem Compute the NEXT Fibbonacci number
170 LET f(n+1) = f(n)+f(n-1)
180 LET n = n+1
190 PRINT f(n-2);" ";
200 rem STOP after printing 20 numbers
210 IF n < 22 THEN GOTO 170</syntaxhighlight>
 
==={{header|Run BASIC}}===
2,169

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.