Given:
Focal length, f = 5 cm
Image distance, v = 25 cm (Image is virtual.)
Applying the lens formula, we get:
1/v 1/u = 1/f (u = Object distance)
1/(25) 1/u = 1/5
or, 1/u =1/(-25)-1/5
or, 1/u =-6/25
or,
u = 25/6 cm
Now,
Magnification, m = v/u
= (25)/(25/6)
= +6