diff --git a/lab13/2.c b/lab13/2.c index a0da2cc..ad8d0fb 100644 --- a/lab13/2.c +++ b/lab13/2.c @@ -1,10 +1,8 @@ #include -long int f[1000] = {0}; - unsigned long int fib(unsigned long int n) { unsigned int i; - + static long int f[1000] = {0}; // better make it static than global... f[0] = 0; f[1] = 1; @@ -25,5 +23,6 @@ int main() { printf("%ld\n", fib(11)); printf("%ld\n", fib(10)); printf("%ld\n", fib(12)); + printf("%ld\n", fib(12)); return 0; }