Qbasic program to display all prime numbers from 1 to 100
Posted by Mahibabu
REM Program to print all prime numbers from 1 to 100
CLS
FOR n = 2 TO 100
FOR k = 2 TO n / 2
flag = 0
r = n MOD k
IF r = 0 THEN
flag = 1
EXIT FOR
END IF
NEXT k
IF flag = 0 THEN PRINT n,
NEXT n
END