The formula for the perimeter of a square is P = 4s, where P is the perimeter and s is the length of one side.
Since one side of the fence is 10m in length, the perimeter of the fence is:
P = 4 × 10m = 40m
Farmer Grant placed posts 2m apart, so the number of posts he used is:
Number of posts = Perimeter ÷ Distance between posts = 40m ÷ 2m = 20 posts
Therefore, Farmer Grant used 20 posts to put a square fence around his vegetable garden.