clear //Given u=4*3.14*10**-7 //T/A m n=20 I=12 //A r=0.1 //m //Calculation B=u*n*I/(2*r) //Result printf("\n Magnetic field at the centre of coil is %0.1f *10**-3 T",B*10**3)