There are ac motors and generators as well as dc motors and generators.
In ac motor we supply ac current and the motor rotates.In ac generator we supply ac current and we get ac voltage which is rectified using brushes and commutators to get dc voltage.
Similarly in dc.motors and generatgrs we give dc current .Principle of motor : A motor works on the principle that when a rectangular coil is placed in a magnetic field and current is passed through it. A force acts on the coil which rotates it continuously. When electric current is passed into the rectangular coil, this current produces a magnetic field around the coil