concerning a cheque A man went into a bank to cash a check. In handling over the money the cashier, by mistake, gave him dollars for cents and cents for dollars. He pocketed the money without examining it and on the way home he spent a nickel. Later on examining it, he found that he had twice the amount of money written on the check.He had no money in his pocket before going to the bank. 
How can we solve this problem? I tried by solving it by making equations but it does not work. The answer is given as $31.63$ on which he received $63.31$ and spent a nickel. But other than guessing, is there any way to find the answer of this problem?

Let $D$ be the number of dollars and $C$ be the number of cents that man actually got.  The amount he got is then $100D+C$ cents, and the amount he wanted was $100C+D$ cents.  After spending the nickel, he had $100D+C-5$ cents, and we know $$100D+C-5 = 2(100C+D)$$ which we can rearrange to $$98D-5  = 199C.$$
The left-hand side is odd, so the right-hand side must be also, so $C$ is odd.
The left-hand side is at most $98\cdot 99 -5 = 9697$, so $C \le \frac{9697}{199} < 49$.
Now consider both sides mod 49. We get $$-5 \equiv 3C\pmod{49}$$
(Because $98D\equiv 0\pmod{49}$ and $199\equiv 3\pmod{49}$.) 
We should find out what value will work on the left-hand side; it must be equivalent to $-5\pmod{49}$.  Since the right-hand side is a multiple of 3, the left-hand side must be also.
$-5$ is not a multiple of 3, and neither is $-5+49 = 44$, but $-5+49+49 =93$ works; we get equality if we take $C=31$.  Similarly $-5+5\cdot 49 = 240$ on the left gives $C=31+49=80$.  But we already know that $C=80$ is too big and not odd, so $C=31$ is the only solution.  Then we have $$98D-5 = 199\cdot 31$$ which gives us $D=63$.
So the answer is: The man asked for $\$31.63$, received $\$63.31$, and after spending a nickel had $\$62.26 = 2\cdot\$31.63$.
(If you would like me to explain any part of this in more details, please leave a comment.)
