Professional Documents
Culture Documents
Trabalho CN - Bisecção
Trabalho CN - Bisecção
implicit none
real a,b,e,x,xb,f
integer k
print*, 'Insira o intervalo'
read*, a,b
print*, 'Insira o e'
read*, e
if ((b-a)<e) then
xb=(a+b)/2
print*, xb
go to 5
endif
k=1
3 x=(a+b)/2
if(f(a)*f(x)<0) then
b=x
else
a=x
endif
if ((b-a)<e) then
xb= (a+b)/2
print*, xb
go to 5
else
k=k+1
go to 3
endif
5 pause
end program