Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
can any one please help me that how to write a program that prompts the user to enter two hexadecimal numbers from 0 to FFFF digits each, and print their sum on the next line in hexadecimal. If the user enters an illegal character, he or she should be prompted to begin again. Each input ends with a carriage return. i wanna know how to add check so that if user enter other than hexadecimal numbers he/she should be prompted about wrong digit.
thanx.
Posted

1 solution

I already answered a similar question for you, at how to add two binary numbers in Assembly language?[^]. You can easily adapt that code to accept hex rather than binary. And printing a hex number character by character is not too difficult if you think about what to do for values greater than 9.
 
Share this answer
 
Comments
Hamza Javed 5-Dec-14 9:45am    
Hmmmmmmmm
ok i will. Thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900