SUM OF DIGITS
DECLARE SUB SUM(N)
CLS
INPUT"ENTER ANY NO.";N
CALL SUM(N)
END
SUB SU8M(N)
S=0
WHILE N<>0
R = N MOD 10
S = S+R
N = N\10
WEND
PRINT"SUM OF DIGITS IS ";S
END SUB
CLS
INPUT"ENTER ANY NO.";N
CALL SUM(N)
END
SUB SU8M(N)
S=0
WHILE N<>0
R = N MOD 10
S = S+R
N = N\10
WEND
PRINT"SUM OF DIGITS IS ";S
END SUB
Comments
Post a Comment