REM This program adds two numbers input by the user.
REM The sum of the numbers is printed to a file.
OPEN "sum.bas" FOR OUTPUT AS #1
CLS

INPUT "Please enter your first number : ", X
INPUT "Please enter your second number : ", Y
sum = X + Y

PRINT #1, "The sum of "; X; "and "; Y; "is "; sum
PRINT : PRINT "Thank you. To see the sum, open the file 'sum.bas'."