Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program sin
- double precision :: f,g,pi
- integer :: i,n,m,d
- pi=acos(-1.0)
- d=0
- f=0
- do n=0,10
- g=1
- i=n
- do m=1,2*n+1
- g=dble(m)*g
- d=d+1
- end do
- f=f+((-1)**(n))*((pi/4)**(2*n+1))/g
- write(6,*) 'sin(pi/4)=',f ,'summe von 0 bis',i
- write(6,*) 'die innere schleife wurde',d,'mal durchlaufen'
- end do
- end program
Add Comment
Please, Sign In to add comment