DECLARE FUNCTION arm(n)
CLS
INPUT "Enter a testing number=";v
IF arm(v)=1 THEN
PRINT v;" is Armstrong Number"
ELSE
PRINT v; " is not Armstrong Number"
ENDIF
END
FUNCTION arm(n)
f=0
a=n
WHILE a<>0
r=a MOD 10
s=s+r^3
a=int(a/10)
WEND
IF s=n THEN f=1
arm=f
END FUNCTION
f=0
ReplyDeletea=n
WHILE a<>0
r=a MOD 10
s=s+r^3
a=int(a/10)
WEND
please describe process
DECLARE FUNCTION armstrong$ (a)
ReplyDeleteCLS
INPUT "enter a no"; a
y$ = armstrong$(a)
PRINT y$
END
FUNCTION armstrong$ (a)
n = a
WHILE a <> 0
r = a MOD 10
t = t + r ^ 3
a = a \ 10
WEND
IF n = t THEN
armstrong$="armstrong"
ELSE
armstrong$="not arm strong"
END IF
END FUNCTION