A bar magnet is placed on a flat surface, with its N-pole on the right. If a compass is placed just above the middle of the magnet, to which direction the compass needle should point?
The needle will point in the left direction. The needle of the compass is actually a north pole. When it is kept just above the middle of a bar magnet with the North pole pointing towards the right side, the needle repels the north pole of the bar magnet and is attracted toward the south pole of the bar magnet. The diagram gives a better understanding.
Since the pointing end of the compass needle is a north pole, it points to the geographic north pole of the Earth. Inside the earth, the geographic north pole is close to the magnetic south pole of the earth and the geographic south pole is close to the magnetic north pole. The north pole end of the needle is attracted to the magnetic south pole and as a result, points to the geographic north pole of Earth.