Here the object is virtual and the image is real.
u = 12 cm object on right and virtual.
1. f = +20 cm
\(\frac{1}{v}\) = \(\frac{1}{f}+\frac{1}{u}\) = \(\frac{1}{20}+\frac{1}{12}\) = \(\frac{2}{15}\)
i.e., v = 7.5 cm. (image on right and real). It is located 7.5 cm from the lens.
2. f = -16 cm
\(\frac{1}{v}=-\frac{1}{16}+\frac{1}{12}=\frac{1}{48}\)
i.e., v = 48 cm. (image on right and real). Image will be located 48 cm from the lens.