In the 19th century, James Joule studied a property, which says that "when an electric current flows through the filament of a bulb, it generates heat, and so the bulb becomes hot". This property is named the heating effect of electric current. <br />When electric current flows through a wire wound around an iron bar, the bar behaves like a magnet. This magnet is called an electromagnet. <br />An electromagnet is formed due to the magnetic effect of electric current. This magnetic effect of electric current was discovered by Hans Christian Oersted. Once, while preparing for a lecture, he noticed that there was a deflection in the needle of a magnetic compass kept near a wire that was connected to a battery. This deflection occurred every time the battery was switched on and off. He realised that a magnetic field is created around a current-carrying wire in a circuit. <br />Read More at https://learnnext.com/lesson/CBSE-VII-Science-The-Magnetic-Effect-of-Electric-Current.htm