It is clear that the two cells oppose each other hence, the effective emf in closed circuit is $$18 - 12 = 6\,V$$ and net resistance is $$1 + 2 = 3\,\Omega $$ (because in the closed circuit the internal resistances of two cells are in series).
The current in circuit will be in direction of arrow shown in figure.

$$I = \frac{{{\text{Effective}}\,{\text{emf}}}}{{{\text{Total resistance}}}} = \frac{6}{3} = 2A$$
The potential difference across $$V$$ will be same as the terminal voltage of either cell.
Since, current is drawn from the cell of $$18\,V,$$ hence,
$${V_1} = {E_1} - i{r_1} = 18 - \left( {2 \times 2} \right) = 18 - 4 = 14\,V$$
Similarly, current enters in the cell of $$12\,V,$$ hence,
$${V_2} = {E_2} + i{r_2} = 12 + 2 \times 1 = 12 + 2 = 14\,V$$
Hence, $$V = 14\,V$$