Answer:
The direction of magnetic field produced by a current carrying wire is given by the right hand thumb rule. If the thumb points in the direction of current the fingers curl along the direction of magnetic field.
further, The red end of the compass needle points in the direction of external magnetic field. As the red end of the needle is pointing away from us, the external magnetic field at its location should also be directed away from us. Using the right hand thumb rule, we can see that this is only possible if the current in the wire is flowing upwards.
Explanation: