In the first example that When a magnetic compass is brought near a current carrying wire, the compass needle gets deflected .How does the
compass deflected east or south ? i know that this happens because the direction of the magnetic field lines produced around a conductor depends on the direction of the current flowing through it. Hence, the direction of the magnetic field lines gets reversed when the direction of the current flowing through the conductor is reversed. but there should be any reason to deflect to east or south .
poles of a magnetic needle are marked as N-S so when it is deflected it will either deflect from south to north or from north to south depending on the direction of the current.