The molecules do gain or loose energy from surrounding all the time depending on the temperature difference. So its not only during the state changes.
Option A.
<h3><u>Explanation:</u></h3>
The molecules in a particle has a particular amount of energy all the time. This is the molecular kinetic energy that owes to the vibration of a molecule at a particular time.
In case of a temperature difference between a matter and its surrounding, the molecules do either absorb energy or emit energy. During a state change, the energy absorption or emission is huge, which leads to the change of state, and there's no change in temperature of the matter at that particular time. So energy changes do occur at any time, not only during the change of state