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

