clear //Given r1=20 r2=25 I=2 //a //Calculation // r=(r1+r2)/2.0 l=(2*%pi*r)*10**-2 n=1500/l u=4*%pi*10**-7 B=u*n*I //Result printf("\n (i) Magnetic field inside the toroid is %0.3f T",B) printf("\n (ii) magnetic field outside the toroid is zero")