DECLARE SUB A(N)
CLS
INPUT"ENTER ANY NO";N
CALL A(N)
END
SUB A(N)
S=0
A=N
WHILE N<>0
R=N MOD 10
S=S+R^3
N=N\10
WEND
IF A=S THEN
PRINT"THE GIVEN NNO IS ARMSTRONG";
ELSE
PRINT"THE GIVEN NO IS NOT ARMSTRONG"
END IF
END SUB
No comments:
Post a Comment