Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  nik
Language: FORTRAN
Code:
program method


real x1,x2,x0,fx1,fx2,fx0
print*,"Enter the starting and ending point"
read*,x1,x2

2 fx1=x1*x1+x1-2
fx2=x2*x2+x2-2

if(fx1==0) then
     print*,"x1 is the root"

if((fx1*fx2)>0) then
     print*,"No roots in this range"
     goto 1
end if

x0=(x1+x2)/2
fx0=x0*x0+x0-2

if(abs(fx0)<0.0001)
print*,x0,"is the root"
goto 1

end if

if(fx1*fx0<0)
x2=x0
goto 2
else x1=x0
goto 2

1 end program method
          
          
          
          
Comments: