Skip to content

Instantly share code, notes, and snippets.

@yask123
Created May 12, 2015 12:03
Show Gist options
  • Select an option

  • Save yask123/45c3866a14313cd17fe1 to your computer and use it in GitHub Desktop.

Select an option

Save yask123/45c3866a14313cd17fe1 to your computer and use it in GitHub Desktop.
# include <stdio.h>
double f(double x,double y)
{
return (x+y);
}
int main()
{
double x0=0;
double y0=1;
double h=0.1;
int i=0;
int n=10;
for(i=0;i<n;i++)
{
y0 = y0 + h * f(x0,y0);
x0+=h;
}
printf("%lf",y0);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment