Computers energy source?

A computers energy source is electricity. When using a computer plugged in or not it is drawing electricity from the battery or from a plug which is connected into the PC and a wall outlet. When there is no electricity the computer cannot function.