1 2 3 4 5 6 7 8 9 10 11 12
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)