FIND THE ANSWERS

Design a code converter that converts a decimal digit from 2421 code to 8,4,-2,-1 code.?

Answer this question

  • Design a code converter that converts a decimal digit from 2421 code to 8,4,-2,-1 code.?


Answers

Answer #1 | 29/12 2013 00:15
Do clarify whether you are referring to 8-4-2-1 code or 8,4 -2, -1 code. I mean what are the weights? 8,4,2,1 or 8,4, -2, -1?
Positive: 66.666666666667 %
Answer #2 | 29/12 2013 13:20
if you are using C++ you will need to use substring or ltrim and rtrim and then multiply the first string by 4 and the third and fourth by -1
Positive: 66.666666666667 %

Possible answer