Last active
August 29, 2015 14:17
-
-
Save joncarlmatthews/b3e97cdb5248e7339186 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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