LINE INPUT and INPUT Statement Example
◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
' This example uses the INPUT statement to prompt the user for a value and
' assign it to a variable. The program calculates the area of a circle.
' To try this example:
' 1. Choose New Project from the File menu
' 2. Copy the code example below to the code window
' 3. Press F5 to run the example
CLS ' Clear the screen
PI = 3.141593: R = -1 ' Declare constants
DO WHILE R
PRINT "Enter radius (or 0 to quit)."
INPUT ; "If radius = ", R
IF R > 0 THEN
A = PI * R ^ 2
PRINT ", the area of the circle ="; A
END IF
PRINT
LOOP