#include #include #define START 22 #define END 45 unsigned fibo( unsigned n ) { if ( n > 2 ) { return fibo(n-1) + fibo(n-2); } else { return 1; } } void main() { int i; int f; time_t t1, t2; float s; for (i = START; i < END; i++) { t1 = clock(); f = fibo(i); t2 = clock(); printf("fibo(%d)=%d ", i, f); s = (float)(t2 - t1) / (float) CLOCKS_PER_SEC; printf("in %3.1f seconds\n", s); } }