Simpson’s 3/8 Rule

Simpson’s 3/8 Rule :

ALGORITHM :

  1. Start of the program.
  2. Input Lower limit a
  3. Input Upper limit b
  4. Input number of sub itervals n
  5. h = (b – a)/n
  6. sum = 0
  7. sum = fun(a) + fun (b)
  8. for i = 1; i < n; i++
  9. if i%3=0:
  10. sum + = 2*fun(a + i*h)
  11. else:
  12. sum + = 3*fun(a+(i)*h)
  13. End of loop i
  14. result = sum*3*h/8
  15. Print Output result
  16. End of Program
  17. Start of Section fun
  18. temp = 1/(1+(x*x))
  19. Return temp
  20. End of section fun
C SOURCE CODE :

OUTPUT : 

simpson's 3/8 rule


Leave a Reply

Your email address will not be published. Required fields are marked *