3 gallon 5 gallon riddle answer

Question: You have a 3-gallon jug, a 5-gallon jug, and an unlimited supply of water. How do you get exactly 4 gallons of water without estimating?

Answer: Fill up the 3-gallon tank and pour it into the 5, refill the 3 gallons again and top off the 5. This leaves 1 gallon left in the 3-gallon tank.

Dump out the 5-gallon tank and pour it in the 1 gallon. fill up the 3-gallon tank completely again and pour it into the 5 to make 4.