Euler’s Method

Source Code:

Write a program in C to solve the differential equation π’‡π’“π’‚π’„π’…π’šπ’…π’™ = 𝒙 + π’š with π’š(𝟎) = 𝟏 at 𝒙 = 𝟎. 𝟏 using Euler’s Method.

#include <stdio.h>
#include <conio.h>
double f(double x,double y){ return x + y; }
int main(){
    clrscr();
    double x=0,y=1,h=0.1;
    y = y + h*f(x,y);
    x = x + h;
    printf("\n\n\ty(%.1f)=%.4f\n",x,y);
    getch();
    return 0;
}

Output