Hello i did the conversion but i still have more questions. Because it doesnt fit that topic anymore i create a new one.
So the problem is simple. It prints out a table where when it hits f it creates a new line, but how do i make it print out in a nicer table, i tried with setw or setfill but it just doesnt work, and if there are any other problems please let me know
You're still having issues with reversals on any two-(or more) digit (hex) number. Your do{} while (a > 0) is printing the least significant digit first, then on to significant.
You can see why:
Assume dec is 47. ( 2F Hex )
47 % 16 is 15 (hex F), so you print "F"
47 / 16 = 2 and 2 % 16 is 2 so you print "2" which is more significant than the F.
If you know what the highest power of 16 will be in your conversion, you can start there:
You probably need to build a string or a char[] to hold your hex digits as you pass through the loop, then cout << setw(4) << (the last value first, then the next, etc).
If you build a string, concatenate the string to your new character rather than the other way around.