The length of each side of an equilateral hexagon is a whole number, and the length of each side of an equilateral octagon is a whole number. Both have the same perimeter. The perimeter must be a multiple of 16 ,18, 24,30 or 36 ?

since there are 6 sides on a hexagon, and 8 sides on an octagon, the perimeter must be a multiple of both 6 and 8. So, it must be a multiple of LCM(6,8) = 24.