REM

CLS

INPUT "ENTER ANY NUMBER"; N

P = 1

WHILE N < > 0

R = N MOD 10

IF R MOD 2 = 1 THEN P = P * R

N = N \ 10

WEND

PRINT "PRODUCT OF ODD DIGITS"; P

END

USING SUB PROCEDURE

DECLARE SUB PROD (N)

CLS

INPUT "ENTER ANY NUMBER"; N

CALL PROD (N)

END

SUB PROD (N)

P = 1

WHILE N < > 0

R = N MOD 10

IF R MOD 2 = 1 THEN P = P * R

N = N \ 10

WEND

PRINT "PRODUCT OF ODD DIGITS"; P

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION PROD (N)

CLS

INPUT "ENTER ANY NUMBER"; N

PR = PROD (N)

PRINT "PRODUCT OF ODD DIGITS"; PR

END

FUNCTION PROD (N)

P = 1

WHILE N < > 0

R = N MOD 10

IF R MOD 2 = 1 THEN P = P * R

N = N \ 10

WEND

PROD = P

END FUNCTION

## No Comments