Petrol, paraffin, gas and oil internal combustion engines generally work on four-stroke
or two stroke cycles. The four stroke completes one engine cycle for every
four strokes of the piston, that is every two revolutions of the crankshaft. The two stroke completes one engine cycle for every
two strokes of the piston, that is each revolution of the crankshaft. Engines
mechanisms working on either cycle can be designed for spark-ignition or compression ignition (diesel)
as the method of initiating combustion according to the engine speed, size, and type of fuel
used.
In essence in a four stroke internal-combustion engine an explosive mixture is drawn into the cylinder on the first stroke,it is compressed and ignited on the second stroke; work is done on the third stroke and the products of combustion are exhausted on the fourth stroke.

Spark ignition cycle...(otto cycle)
Note: The motion of the piston during the charging, compression and exhaust strokes is driven
by the inertia of the a flywheel which is used to ensure smooth continuous motion.
Compression ignition cycle...(diesal cycle)
Notes on the theoretical consideration of the otto and deisel cycles are found on
page Thermodynamic cycles

In the combustion phase an ignited charge exerts pressure on the piston crown whilst a
fresh charge is drawn through the carburettor into the crankcase via inlet port I.
During the exhausting phase the piston moving down partly uncovers the exhaust port E
allow the combustion gases to start to discharge. The downward movement of the
piston also compresses the fuel air mixture in the crankcase.
At the end of the first stroke the exhaust port are fully open and the fuel inlet port P is now open allow
the compressed fuel mixture to enter the cylinder above the piston. The piston crown
is so shaped that the mixture is deflected upwards above the residue of the escaping exhaust gases.
The fuel mixture helps to sweep out the exhaust gases.
During the upward compressing stroke, the piston covers the transfer ports , compresses the charge and creates
a small vacuum in the crankcase. At the end of the upward stroke (inner dead centre) ignition
occurs resulting in the ignited charge expanding and exerting pressure on the piston.