A cycle followed by a machine

A cycle followed by a machine (made of one mole of perfect gas in a cylinder with a piston) is shown in figure

(i) A to B
(ii) C to D