program Monte_Karlo
USE NUMERICAL_LIBRARIES
implicit none


real*8, parameter::  a=0,b=1
integer, parameter:: k=1000
real*8 x,y,int,r(k)
integer i ,iseed

open(30,file='integral2.dat',status='unknown')



ISEED = 123457
CALL RNSET (ISEED)
CALL dRNUN (k,R)


int=0
x=0
y=0
print*, iseed

do i=1,k
x=r(i)

y=1/(1+x)



int=int+((b-a)/k)*y



write(30,100)x,y,int
enddo 

print*,int,0.69

100 format(10(e13.7,2x))


stop

end

