Question -
Answer -
A solenoid is a long coil of circular loops of insulated copper wire. The magnetic field produced around the solenoid when the current is passed through it is similar to the magnetic field produced around the bar magnet when current is passed through it. The figure shown below shows the arrangement of magnetic fields produced around the solenoid when current is passed through it.
When the north pole of the bar magnet is brought close to the end connected to the negative terminal of the battery, the solenoid repels the battery. As like poles repel each other, we can infer that the end connected to the negative terminal behaves as a north pole while the end connected to the positive terminal behaves as a south pole.