# Sum of digits.(sub)

DECLARE SUB SUM(n )
CLS
INPUT "Enter any number";n
CALL SUB (n )
END

SUB SUM (n)
S=0
WHILE n< > 0
R=n MOD 10
S=S+R
N=N/10
WEND
PRINT " sum of digits =";s
END SUB

Comments

Popular posts from this blog