1 2 3 4 5 6 7 8 9 10 11
clear //Given H=0.40 a=18 //degree //Calculation // R=H/(cos(a*3.14/180.0)) //Result printf("\n Magnitude of earths magnetic field is %0.2f G",R)