QBASIC PROGRAM TO FIND BINARY EQUIVALENT OF DECIMAL NUMBER



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

Post a Comment

0 Comments