home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
w3_prog
/
lbas09p2.arj
/
FOR_NEXT.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-01-22
|
537b
|
26 lines
PRINT"Compute a Factorial"
INPUT"Enter a number"+">"; start
factorial = 1
FOR index = 1 TO start
factorial = factorial * index
NEXT index
PRINT"The factorial of "; start; " is "; factorial
PRINT
PRINT"Compute a Reciprocal"
INPUT">"; start
PRINT"The reciprocal of "; start; " is "; 1/start
PRINT
PRINT"Compute a Square"
INPUT">"; start
PRINT"The square of "; start; " is "; start*start
FOR x = 1 TO 5 STEP .3
PRINT x*x
NEXT x