Which rule below correctly describes the attraction and repulsion of magnets?
A. Magnetic poles attract all other magnetic poles.
B. Magnetic poles attract or repel each other only within the gravitational field of Earth.
C. Like poles repel each other while opposite poles attract.
D. Opposite charges attract each other and like charges repel.