Module Module1
    Function f(ByVal x As Double, ByVal y As Double) As Double
        Return y + x
    End Function
    Function g(ByVal x As Double) As Double
        Return Math.Exp(x) - x - 1
    End Function
    Sub Main()
        Dim y0, x0, h, xk, l As Double
        x0 = 0
        h = 0.1
        xk = 1
        y0 = 0
        Console.WriteLine("Начальное условие :x0 = 0, y0 = 1")
        Console.WriteLine()
        Console.WriteLine()
        Console.WriteLine("x_кон. = 1    шаг по x: 0,1")
        Console.WriteLine()
        Console.WriteLine()
        Console.WriteLine("  x     м-д Эйлера   Точное зачение   Погрешность")
        Console.WriteLine("---------------------------------------------------")
        Console.WriteLine("{0,4:f1}  {1,10:f4}  {2,14:f4}  {3,12:f4}", x0, y0, l, l - y0)
        For i As Double = 0 To CInt((xk - x0) / h) - 1
            y0 = y0 + h * f(x0, y0)
            x0 = x0 + h
            l = g(x0)
            Console.WriteLine("{0,4:f1}  {1,10:f4}  {2,14:f4}  {3,12:f4}", x0, y0, l, l - y0)
        Next i
        Console.ReadLine()


    End Sub

End Module
