31. juli 2003 - 14:36Der er
4 kommentarer og 1 løsning
regnemaskine til Hex , Dec og Binær værdier
Jeg har siddet og forsøgt at lave en regnemaskine der kan omregne Decimal tal til Binære tal, samt Hexadecimal, men jeg kan ikke få det til at fungere. Programmet skal fungere sådan at man skal taste en værdi og få de to andre????
Output: Dec 0 hex: 0 bin: 0 Dec 1 hex: 1 bin: 1 Dec 2 hex: 2 bin: 10 Dec 3 hex: 3 bin: 11 Dec 4 hex: 4 bin: 100 Dec 5 hex: 5 bin: 101 Dec 6 hex: 6 bin: 110 Dec 7 hex: 7 bin: 111 Dec 8 hex: 8 bin: 1000 Dec 9 hex: 9 bin: 1001 Dec 10 hex: a bin: 1010 Dec 11 hex: b bin: 1011 Dec 12 hex: c bin: 1100 Dec 13 hex: d bin: 1101 Dec 14 hex: e bin: 1110 Dec 15 hex: f bin: 1111 Dec 16 hex: 10 bin: 10000 Dec 17 hex: 11 bin: 10001 Dec 18 hex: 12 bin: 10010 Dec 19 hex: 13 bin: 10011 Dec 20 hex: 14 bin: 10100 Dec 21 hex: 15 bin: 10101 Dec 22 hex: 16 bin: 10110 Dec 23 hex: 17 bin: 10111 Dec 24 hex: 18 bin: 11000 Dec 25 hex: 19 bin: 11001 Dec 26 hex: 1a bin: 11010 Dec 27 hex: 1b bin: 11011 Dec 28 hex: 1c bin: 11100 Dec 29 hex: 1d bin: 11101 Dec 30 hex: 1e bin: 11110 Dec 31 hex: 1f bin: 11111
Sørens itoa til at udskrive binært er lidt fiksere en min kode.
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.