The pattern of the magnetic field associated with the solenoid is similar to the pattern of the magnetic field around a bar magnet. Thus, the divergence of magnetic field lines near the ends of a current carrying straight solenoid indicates that the magnetic field is strongest near the ends of the solenoid and weakens as we move away. Also, ends become the poles of the magnet thus formed.