read *,n a=0. b=3.1415926536 dx=(b-a)/n do i=1,n x=a+i*dx-dx/2. f=sin(x) sum=sum+f*dx enddo print*,sum stop end