K 2 things before we go any further:
(1) We assume that we are going clockwise;
(2) For convenience, we will calculate the angles as if there's another hand pointing at 12 (and you will see why).
First off, the angle between every 2 consecutive numbers will be 360/12 = 30 degrees.
Since it's 3:40, the minute hand will point at 8. From 12 to 8 (remember: clockwise!), the angle is (8-0)*30 = 240 degrees.
The tricky part is the position of the hour hand. Here's the thing: if the hour hand points at 3 right now, 60 minutes later it will point at 4, or 3and60/60. Then at 3:40, the hour hand will be pointing at 3and40/60. From 12 to 3and40/60, the angle is (3and40/60 - 0)*30 = 110 degrees.
To find the angle between the 2 hands will be 240-110=130 degrees.
Ask me further if you still have any question regarding the position of the hour hand though: my apology that it might not be clear at all.