Advertisement
Guest User

haha

a guest
Apr 24th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. program haha
  2. implicit none
  3. real :: x, op, ft
  4. integer :: n
  5. x=20.0
  6. n=10000
  7. op =ft(x,n)
  8. print *, op, 'is the result'
  9. end program haha
  10.  
  11.  
  12. FUNCTION ft(x,n)
  13. implicit none
  14. real:: x, m, ft
  15. integer :: i,n
  16. ft=0
  17. m=0
  18. do i=1,n
  19. m=ft
  20. ft=m+sin(x*i)+cos(x*i)
  21. end do
  22. print *,'addition is', ft
  23. end function ft
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement