skip to main |
skip to sidebar
Display only Armstrong Numbers from 1 to 1000
DECLARE SUB arm ()
CLS
CALL arm
END
SUB arm
PRINT "Armstrong numbers from 1 to 1000 are "
FOR n = 1 TO 1000
i = n
a = 0
WHILE i <> 0
r = i MOD 10
a = a + (r ^ 3)
i = i \ 10
WEND
IF a = n THEN PRINT a
NEXT n
END SUB
**********************************
Ą