Program FindRoot Implicit None Real :: a, b, x, ft_f Integer :: maxit,id Do Print *, " Type bound (a, b) = " Read *, a,b ! Print *, " Type the # of iterations maxit = " ! Read *, maxit ! If (maxit==0) Stop maxit = 200 Print *, " Bisection(1), Newton(2), Stop(0) " Read *, id If (id==0) Stop If (id == 2) then Call Newton(x,a,maxit) Else Call Bisection(x,a,b,maxit) EndIf print *, "------------------------------------------" If (id==2) then print *, " The Result by Newton Iteration " Else print *, " The Result by Bisection Iteration " EndIf write (*,"(A20,pE23.16)") " The root is ", x write (*,"(A20,pE23.16)") " The value is ", ft_f(x) write (*,"(A20,I4)") " The iteration is ", maxit print *, "------------------------------------------" EndDo End Program FindRoot