home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er 1990 December
/
64er_Magazin_90-12_1990_Markt__Technik_de_Side_A.d64
/
hexadezim.zahlen
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
659b
|
30 lines
10 print"[147]":rem umrechnung dezimalzahl in hexzahl
20 print"umrechnung dezimalzahl in hexzahl"
30 print"*********************************"
40 print:input" dezimalzahl";d
50 s=int(d/16)
60 r=d-s*16
70 ifr<=9thenh$=chr$(r+48)+h$
80 ifr>9thenh$=chr$(r+55)+h$
90 ifs>15thend=s:goto50
100 ifs=0then130
110 ifs<=9thenh$=chr$(s+48)+h$
120 ifs>9thenh$=chr$(s+55)+h$
130 print:print" hexzahl="h$
140 print:h$="":goto40
160 :
170 :
200 print"[147]":rem umrechnung hexzahl in dezimalzahl
210 print"umrechnung hexzahl in dezimalzahl"
220 print"*********************************"
230 print:input" hexzahl";h$
240 l=len(h$)
250 fori=lto1step-1
260 s=asc(mid$(h$,i,1))
270 ifs<60thend=d+(s-48)*16^e
280 ifs>60thend=d+(s-55)*16^e
290 e=e+1
300 nexti
310 print:print" dezimalzahl="d
320 d=0:e=0:goto230