Sum of digit using sub

Sum of digit using sub

DECLARE SUB SUM(N)
CLS
INPUT"ENTER ANY NO";N
CALL SUM(N)
END

FUNCTION SUM (N)
S=0
WHILE N<>0
R=N MOD 10
S=S+R
N=N\10
WEND
PRINT"SUM OF EVEN DIGIT";S
END SUB

Comments

Popular posts from this blog

Hiking

experience of SEE exam cancelled and covid -19

My journey in jagat mandir school