Declare Sub Hex (H$)
CLS
INPUT "Hexadecimal No"; H$
Call Hex(H$)
END
Sub Hex (H$)
L = Len (H$)
While l>0
Z$= UCASE$(MID$(H$,l,1))
SELECT CASE Z$
CASE "A"
N = 10
CASE "B"
N = 11
CASE "C"
N = 12
CASE "D"
N = 13
CASE "E"
N = 14
CASE "F"
N = 15
CASE ELSE
N = VAL (Z$)
END SELECT
DECI = DECI + N*16^P
P = P+1
L = L -1
WEND
PRINT H$ ; = "DECI"
END SUB
No comments:
Post a Comment