Such magnets are called temporary magnets. An electromagnet is a temporary magnet. It is made by winding a coil of insulated wire round a soft iron core. When a current is passed through the coil, the magnetic field produced by the current magnetises the soft iron core. The soft iron core loses all the magnetism when the current is switched off.
So A