---------------------------------------------------------------------------------------------------------------------------
PROGRAM nioton
IMPLICIT NONE
INTEGER::k,i
REAL::x,fpx,fx,c,e,y
!F(x)= x - cos(x)
PRINT*
PRINT*," F(X) = X - cos(X) X = ? "
PRINT*
PRINT*," Nerkhe hamgarayi ra vared konid : "
READ*,c
x=0
k=0
DO
k=k+1
y=x
fx=x - COS(x)
fpx=1 + SIN(x)
x=x-(fx/fpx)
e=(ABS(x-y))/ABS(x)
IF (e < c) EXIT
END DO
PRINT*," Javab dar tekrar",k," barabar ast ba : X =",x
PRINT*
END