What is the role of a nozzle in a jet engine?

Explanation:

The nozzle in a jet engine accelerates the exhaust gases, which generates thrust by ejecting the gases at high speed in the opposite direction of the aircraft’s motion.