code runs, but not the way it's supposed to

Hexadecimal numerals are integers written in base 16.The 16 digits used are '0'
through '9' plus 'a' for the "digit 11",'c' for the "digit 12",'d' for the
"digit 13",'e' for the "digit 14", and 'f' for the "digit 15".For example the hexadecimal numeral d is the same as base 10 numeral 14 and the hexadecimal numeral 1d is the same as the base 10 numeral 30.Write a C++ program to perform addition of two hexadecimal numerals each with up to 10 digits. If the result of the addition is more than 10 digits long, then simply give the output message “Addition Overflow” and not the result of the addition. Use arrays to store hexadecimal numerals as arrays of characters. Include a loop to repeat this calculation for new numbers until the user says she or he wants to end the program.


fixed
Last edited on
How is it supposed to run? Please tell us the expected output and actual output.
try debugging to check the values of the variables to see where you went wrong
The answer is supposed to be in 1s and 0s.
At present it cannot be in 1s and 0s because for instance your following statement:
total[i] = char('A' + t - 10);
Makes total[i] a char.

You will have to make a function to convert a hex number to a binary number and output it accordingly.
the program needs to convert hexa to binary?
Topic archived. No new replies allowed.