By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,943 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,943 IT Pros & Developers. It's quick & easy.

convert BCD to 16-bits integer

P: 1
Convert a 4 digit number stored in a global array bcdval[4] in the format of Binary Coded Decimal (BCD) to a 16‐bit integer value stored in global variable ival. Sample of input and output:
char bcdval[4] = {2, 9, 8, 7};
int ival; Gives ival = 0x0BAB
Sep 11 '10 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
This looks like a homework assignment.

First: How do you convert any integer to BCD?

Of you can do it on paper theb yu can code it.

Please post your paper conversion.
Sep 11 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.