0
About conversion of number systems
how to print the exchanges of integers by creating an array? such as 2345 of decimals,and change the example into hexadecimal? and another problem is achieve the goal by using dynamic array?
2 Réponses
+ 2
Actually, I wouldn't use an array... Especially beacouse you have to convert integers in to char(10 = a in hexadecimal). First you have to convert the number in binary (and that's easy, I'll put an example code in the description), the you have to divide the binary code in to nibbles (groups of four digits starting from right to left, from the LSB to the MSB, and add digits to the last nibble if it isn't formed by four digits, Example: 101101, you have to add 00 before 101101, so it will be 00101101), after doing this, you have to convert each nibble in to hexadecimal, (maybe using switch()) or you can convert every nibble from binary to decimal, and from decimal to hexadecimal.
+ 1
I forgot the code...
https://code.sololearn.com/ca212aa8mi5O/?ref=app