QBASIC PROGRAM TO CONVERT DECIMAL VALUE INTO OCTAL EQUIVALENT VALUE
CLS
INPUT "ENTER DECIMAL NUMBER"; D
WHILE D < >0
R = D MOD 8
S$ = STR$(R) + S$
D = D 8
WEND
PRINT "OCTAL EQUIVALENT VALUE="; S$
END
USING SUB
DECLARE SUB DOCT(D)
CLS
INPUT "ENTER DECIMAL NUMBER"; D
CALL DOCT(D)
END
SUB DOCT(D)
WHILE D < >0
R = D MOD 8
S$ = STR$(R) + S$
D = D 8
WEND
PRINT "OCTAL EQUIVALENT VALUE="; S$
END SUB
0 Comments