Skip to content

Instantly share code, notes, and snippets.

@joncarlmatthews
Last active August 29, 2015 14:17
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 joncarlmatthews/b3e97cdb5248e7339186 to your computer and use it in GitHub Desktop.
Save joncarlmatthews/b3e97cdb5248e7339186 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(int argc, const char * argv[])
{
short unsigned int i;
short unsigned int fib[15];
fib[0] = 0;
fib[1] = 1;
printf("1 %i\n", fib[0]);
printf("2 %i\n", fib[1]);
for (i=2; i<15; i++) {
fib[i] = fib[(i-2)] + fib[(i-1)];
printf("%i %i\n", (i+1), fib[i]);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment