CLS

INPUT "ENTER ANY NUMBER"; N

S = 0

WHILE N < > 0

R = N MOD 10

IF R MOD 2 = 1 THEN S = S + R

N = N \ 10

WEND

PRINT "SUM OF ODD DIGITS"; S

END

USING SUB PROCEDURE

DECLARE SUB SUMODD (N)

CLS

INPUT "ENTER ANY NUMBER"; N

CALL SUMODD (N)

END

SUB SUMODD (N)

S = 0

WHILE N < > 0

R = N MOD 10

IF R MOD 2 = 1 THEN S = S + R

N = N \ 10

WEND

PRINT "SUM OF ODD DIGITS"; S

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION SUMODD (N)

CLS

INPUT "ENTER ANY NUMBER"; N

SU = SUMODD (N)

PRINT "SUM OF ODD DIGITS"; SU

END

FUNCTION SUMODD (N)

S = 0

WHILE N < > 0

R = N MOD 10

IF R MOD 2 = 1 THEN S = S + R

N = N \ 10

WEND

SUMODD = S : END FUNCTION

## No Comments