Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program haha
- implicit none
- real :: x, op, ft
- integer :: n
- x=20.0
- n=10000
- op =ft(x,n)
- print *, op, 'is the result'
- end program haha
- FUNCTION ft(x,n)
- implicit none
- real:: x, m, ft
- integer :: i,n
- ft=0
- m=0
- do i=1,n
- m=ft
- ft=m+sin(x*i)+cos(x*i)
- end do
- print *,'addition is', ft
- end function ft
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement