ALGORITHM OF SIMPSON’S 1/3 RULE
1-Enter value of upper limit & lower limit
2-Enter value of sub-interval(n)
3-h=(b-a)/n
4-s=y(a)+y(b)
5-For (j=1 to n-1) dø
if( j%2==0)
{
s= s+2*y(a+j*h)
else
s=s+4*y(a+j*h)
}
}
6-Result = (h/3)*s
7-Print “result”
8- exit( )
No comments:
Post a Comment