Module Module1
    Function y(ByVal x As Double) As Double
        Return Math.Atan(10 * x)
    End Function
    Function diff(ByVal x As Double) As Double
        Return 10 / ((Math.Cos(10 * x)) ^ 2)
    End Function
    Sub Main()
        Do
            Console.Clear()
            Console.WriteLine(" enter initial value of x")
            Dim x As Double = Double.Parse(Console.ReadLine())
            Dim eps As Double = 0.00001 : Dim n As Integer = 0
            Console.WriteLine(" Medium value of x")
            Do
                Console.WriteLine("      {0:f5}", x)
                x = x - y(x) / diff(x)
                n += 1
            Loop Until Math.Abs(y(x) / diff(x)) < eps
            Console.WriteLine(" Root = {0}  Number of iterations = {1}", x, n)
            Console.ReadLine()
        Loop
    End Sub

End Module
