Dan had $ 3 left with him after he bought a candy bar. If he had $ 4 at the start how much did the candy bar cost?
Let's say that the cost of the candy bar is $x$. 

Then we have the equation: 

$4 - x = 3$

$x = 1$

So the candy bar cost $1$.