Step-by-step explanation:
When the nail is placed in a cup of hot water,the temperature of the nail increases because it is in contact with hot temperature and metals are good conductors of heat.
When the nail becomes hot,the temperature of the nail increases.This causes an increase in the kinetic energy of the atoms of the metal.
This kinetic energy is used as vibrational kinetic energy and the atoms vibrate with increased amplitude.The motion of the atoms become more chaotic,irregular and random.