When an electric fan is switched on in the closed room, first electrical energy is converted into mechanical energy then mechanical energy is converted into heat. The heat energy will increase the kinetic energy of air molecules, hence the temperature of the room will increase.