Question 8
Back to Exercise
How should a billing program store rupee amounts?
- A float
- B An integer number of paise (e.g. long long) Correct
- C double
- D A string
Correct Answer: Option B
Binary floating point cannot represent amounts like 0.10 exactly, so totals drift and equality checks fail. Whole paise in a 64-bit integer are exact; convert to rupees only when printing.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!