Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 3, 2019 04:42
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 parzibyte/004799b97f65838f4646b0715607a0da to your computer and use it in GitHub Desktop.
Save parzibyte/004799b97f65838f4646b0715607a0da to your computer and use it in GitHub Desktop.
long fibonacci(long posicion, int imprimir) {
long siguiente = 1, actual = 0, temporal = 0;
for (long x = 1; x <= posicion; x++) {
if (imprimir)
printf("%ld, ", actual);
temporal = actual;
actual = siguiente;
siguiente = siguiente + temporal;
}
if (imprimir)
printf("%ld", actual);
return actual;
}
@ryokib
Copy link

ryokib commented Jan 25, 2023

Hi parzibyte,

I am learning currently C programm at uni and trying to understand the code you have shared, when I put it in the compiler cannot compile, have added stdio.h libraries but still nothing... could you share what you think am doing wrong :) beginners problems I believe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment