Option Strict On
Module Module1
    Function diff(ByVal x As Double, ByVal y As Double) As Double
        Return x + y
    End Function
    Function exact(ByVal x As Double) As Double
        Return Math.Exp(x) - x - 1
    End Function
    Sub Main()
        Console.WriteLine("Начальное условие: x0 = 0, y0 = 0")
        Console.WriteLine()
        Console.WriteLine(" х_кон. = 1          шаг по х:  0,1")
        Console.WriteLine()
        Console.WriteLine(" х    м-д  Эйлера   Точное значение   погрешность")
        Console.WriteLine(" ------------------------------------------------------")
        Dim h As Double = 0.1
        Dim x As Double = 0
        Dim y As Double = 0
        Dim xMax As Double = 1
        Dim precise As Double
        For i As Double = 0 To xMax Step h
            'CInt(xMax / h)
            precise = exact(x)
            Console.WriteLine(" {0:f1}       {1:f4}          {2:f4}         {3:f4} ", x, y, precise, precise - y)
            y = y + h * (diff(x, y))
            x = x + h
        Next i
        Console.ReadLine()
    End Sub

End Module
