Thursday, October 31, 2019

Wap to find 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

No comments:

Post a Comment

Journey with jagat mandir

        My journey with Jagat Mandir School My first day and my first step in jagat mandir was on 2067. On the first day I came with my ...