program test
real::x,t,s
integer::i
print*,"Enter the angle in degree:"
read(*,*)x
!converting the angle to radian from degree
x=x*3.14159/180
t=x
s=x
i=0
2 i=i+1
t=-t*x*x/(2*i*(2*i+1))
s=s+t
if(abs(t)>0.00001)then
goto 2
else
print*,s
endif
end
real::x,t,s
integer::i
print*,"Enter the angle in degree:"
read(*,*)x
!converting the angle to radian from degree
x=x*3.14159/180
t=x
s=x
i=0
2 i=i+1
t=-t*x*x/(2*i*(2*i+1))
s=s+t
if(abs(t)>0.00001)then
goto 2
else
print*,s
endif
end
Comments
Post a Comment