Simpson’s 1/3 Rule

Simpson’s 1/3 rule :

ALGORITHM :

  1. Start of the program.
  2. Input Lower limit a
  3. Input Upper limit b
  4. Input number of subintervals n
  5. h=(b–a)/n
  6. sum=0
  7. sum=fun(a)+4*fun(a+h)+fun(b)
  8. for i=3; i<n; i + = 2
  9. sum + = 2*fun(a+(i – 1)*h) + 4*fun(a+i*h)
  10. End of loop i
  11. result=sum*h/3
  12. Print Output result
  13. End of Program
  14. Start of Section fun
  15. temp = 1/(1+(x*x))
  16. Return temp
  17. End of Section fun

C SOURCE CODE :

OUTPUT :

simpson's 1/3 rule

Leave a Reply

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