clear //Given K=0.095 //A n=50 r=10*10**-2 //m u=4*%pi*10**-7 //Calculation H=K*u*n/(2.0*r) //Result printf("\n Horizontal component of earths magnetic field is %0.3f *10**-4 T",H*10**4)