Está en la página 1de 2

Program Punto_Fijo

Implicit none
Real::x0,x1,Tol,Error
Integer::I
Real,External::F

Print*,'Ingrese x0 ='
Read*,x0
Print*,'Ingrese Tol ='
Read*,Tol
I=0

Do
x1=F(x0)
I=I+1
Error=abs(x1-x0)
print*,'Error'
Print'(F10.4)',Error
If((Error<Tol).Or.(I==1000)) Then
Print*,'El punto Fijo es =',x1
Print'(F15.3)',x1
Print*,'I=',I
Exit
Else
x0=x1
End If
End Do

End Program Punto_Fijo

Function F(x)
Implicit none
Real::F,x
F=x*x+5*x+6
End Function F

También podría gustarte