fork download
  1. program integr
  2. implicit none
  3.  
  4. real :: x, x1, x2, x3, b, b1, b2, b3, I
  5.  
  6.  
  7. !h=(b-a)/3
  8.  
  9. x = 0.0
  10. b = (sin(x))**2.0
  11.  
  12. x1 = 3.141592/6.0
  13. b1 = (sin(x1))**2.0
  14.  
  15. x2 = 3.141592/3.0
  16. b2 = (sin(x2))**2.0
  17.  
  18. x3 = 3.141592/2.0
  19. b3 = (sin(x3))**2.0
  20.  
  21. I = x3*(b + 3.0*b1 + 3.0*b2 + b3)/8.0
  22.  
  23. Print *,"La Integral numerica es ", I
  24.  
  25.  
  26. end program integr
Success #stdin #stdout 0.01s 2620KB
stdin
Standard input is empty
stdout
 La Integral numerica es    0.78539783