REM This program lists the divisors of a positive integer.
DEFLNG K, N
DEFSNG H
Begin:
CLS
REM Prompt for integer.
INPUT "What is the positive integer"; N
PRINT
PRINT "The divisors of"; N; "are:"
PRINT
REM Find and print the divisors.
K = 1
HALF = N / 2
DO WHILE K <= HALF
IF N MOD K = 0 THEN PRINT K; ",";
K = K + 1
LOOP
PRINT N
REM Prompt for repeat
PRINT
INPUT "Do you want to run the program again (enter y or n)"; ans$
IF ans$ = "y" OR ans$ = "Y" THEN GOTO Begin
PRINT
PRINT "OK - up to you!"
END