Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (15 sloc) 288 Bytes
#include <stdio.h>
int fib(int n) {
if (n == 0 || n == 1) {
return n;
} else {
return fib(n - 1) + fib(n - 2);
}
}
int main(int argc, char *argv[]) {
int i = 0;
for(i = 0; i < 36; i++) {
printf("n=%d => %d\n", i, fib(i));
}
return 0;
}
Jump to Line
Something went wrong with that request. Please try again.