Skip to content

Instantly share code, notes, and snippets.

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

  • Save yask123/9c3387460d0b931a075d to your computer and use it in GitHub Desktop.

Select an option

Save yask123/9c3387460d0b931a075d to your computer and use it in GitHub Desktop.
# include <stdio.h>
double f(double x,double y)
{
return (x+y);
}
int main()
{
double h=0.2;
double x,y;
x=0;
y=1;
double k1 = h * f(x,y);
double k2 = h * f((x+h/2),(y+k1/2));
double k3 = h * f((x+h/2),(y+k2/2));
double k4 = h * f(x+h,y+k3);
double k5 = 0.16 *(k1 + 2*k2 + 2*k3 + k4);
printf("%f",k5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment