CLS
INPUT "ENTER DECIMAL NUMBER"; D
WHILE D < > 0
R = D MOD 2
S$ = STR$(R) + S$
D = D \ 2
WEND
PRINT "BINARY EQUIVALENT VALUE"=; S$
END
USING SUB
DECLARE SUB BINARY(D)
CLS
INPUT "ENTER DECIMAL NUMBER"; D
WHILE D < > 0
R = D MOD 2
S$ = STR$(R) + S$
D = D \ 2
WEND
PRINT "BINARY EQUIVALENT VALUE"=; S$
END SUB
0 Comments