When current is passed through a solenoid coil, magnetic field produced due to each turn of solenoid coil is in the same direction. As a resu1t, the resultant magnetic field become very strong and uniform. The field lines inside the solenoid are in the form of parallel straight lines along the axis of solenoid. Thus, the solenoid behaves like a bar magnet. One end of solenoid behaves as a magnetic North pole while the other end behavesas the South Pole.
We can determine the magnetic poles formed in a solenoid. The end of the current-carrying solenoid, which attracts North Pole but repels South Pole of a bar magnet, is behaving as south magnetic pole. The other end, which attracts South Pole of a bar magnet but repels the North Pole, is behaving as north magnetic pole. It is because like poles repel but unlike poles attract each other.