Question: how npn and pnp transistor works?
Answer: In an NPN transistor, a positive voltage is given to the collector terminal to produce a current flow from the collector to the emitter. In a PNP transistor, a positive voltage is given to the emitter terminal to produce current flow from the emitter to collector.