program enshu11a                          
implicitnone
real::x,y,ya,yb
real::a,b,verysmall
integer::i
a=1.0
b=10.0
verysmall=1.0e-2
ya=a**2-2.0
yb=b**2-2.0
if(ya*yb>0.0)stop
doi=1,99
x=0.5*(a+b)
y=x**2-2.0
write(*,*)i,x,abs(x-sqrt(2.0)),a,b,y
if(b-a<verysmall)exit
if(y<=0.0)then
?=x
else
?=x
endif
enddo
write(*,*)i,x,abs(x-sqrt(2.0))
endprogramenshu11a