Exam-style question
Try this first
Which example shows a character code being incorrectly treated as a pure binary number?.
- A.Displaying a stored digit character as text.
- B.Comparing the code for the character '6' with the code for another character.
- C.Adding the character code for '6' directly to a numerical value as if the code itself were the value six.
- D.Storing a numerical value using binary.
Model answer
What a good answer should say
- Adding the character code for '6' directly to a numerical value as if the code itself were the value six.
Explanation
Why this works
A character code identifies the character '6'; it is not automatically the numerical value 6. Treating the code as the value can produce an incorrect result unless a suitable conversion is performed.
Common mistake
No common mistake is linked to this question yet.
