Friction is the force resisting the relative motion of solid surfaces, fluid layers, and material elements sliding against each other. friction affects the energy output because it takes some of the input energy to make friction, to account that energy is conserved the friction in machine D is input - output, 100 - 60 = 40 joules