Skip to content

Instantly share code, notes, and snippets.

Created April 10, 2013 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5357459 to your computer and use it in GitHub Desktop.
Save anonymous/5357459 to your computer and use it in GitHub Desktop.
int main(int argc, char *argv[]) {
int n=50;
float h=0.1;
float y[n];
float x[n];
x[0]=0;
x[1]=h;
y[0]=1;
y[1]=1-h;
printf("x %d\n", x[0]);
printf("y %d\n", y[0]);
printf("x %d\n", x[1]);
printf("y %d\n", y[1]);
int i;
for(i=2; i<n; i++) {
x[i]=i*h;
y[i]=y[i-2]-2*h*y[i-1];
printf("x %d\n", x[i]);
printf("y %d\n", y[i]);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment