Qbasic Program to convert decimal to hexadecimal
Posted by Mahibabu
REM Program to convert decimal to hexadecimal
CLS
INPUT "Enter decimal number"; d
WHILE d <> 0
r = d MOD 16
IF r = 10 THEN
r$ = "A"
ELSEIF r = 11 THEN
r$ = "B"
ELSEIF r = 12 THEN
r$ = "C"
ELSEIF r = 13 THEN
r$ = "D"
ELSEIF r = 14 THEN
r$ = "E"
ELSEIF r = 15 THEN
r$ = "F"
ELSE
r$ = STR$(r)
END IF
h$ = r$ + h$
d = d \ 16
WEND
PRINT "Hexadecimal is"; h$
END