clear //Given u=-10.0 //cm m=-3.0 //Calculation v=m*u f=1/((1/v)-(1/u)) //Result printf("\n Image formed at %0.3f cm",v) printf("\n Focal length is %0.3f cm",f)