Created
September 27, 2012 08:55
-
-
Save bastianccm/3792976 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
thebod:~/Dropbox/fib_c$ wc -c fib.c | |
98 fib.c | |
thebod:~/Dropbox/fib_c$ cat fib.c | |
f(x){return x>1?f(x-1)+f(x-2):x;}main(int i,int**v){for(i=0;i<atoi(v[1]);)printf("%i\n",f(i++));} | |
thebod:~/Dropbox/fib_c$ gcc -o fib fib.c | |
fib.c: In function ‘main’: | |
fib.c:1: warning: incompatible implicit declaration of built-in function ‘printf’ | |
thebod:~/Dropbox/fib_c$ ./fib 10 | |
0 | |
1 | |
1 | |
2 | |
3 | |
5 | |
8 | |
13 | |
21 | |
34 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment