How does a steam engine do work?

(a) steam enters a cylinder and pushes a piston.

(b) steam expands and spins an axle.

(c) steam turns a turbine.

(d) steam causes wheels to turn.