Option Strict On
Module Module1
    Function diff(ByVal x As Double, ByVal y As Double) As Double
        Return Math.Cos(x) + Math.Sin(y)
    End Function
    Sub Main()
        Console.WriteLine(" x    y       Y'        h/2n       2n")
        Console.WriteLine("-----------------------------------------------")
        Dim x As Double = 2.5
        Dim y As Double = 0
        Dim h As Double = 0.25
        Dim xmax As Double = 4
        Dim eps As Double = 0.001
        Dim _2n As Integer = 128
        Console.WriteLine(" {0}   {1}    {2}", x, y, diff(x, y))
        For i As Integer = 1 To _2n
            Console.WriteLine(" {0}   {1}    {2}    {3}  {4}", x, y, diff(x, y), h / _2n, _2n)
        Next i
        Console.ReadLine()
    End Sub

End Module
