From 9b9abb6bb4def6a8431678f2d4ea0efc38278729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nut=CC=A6iu?= Date: Thu, 26 May 2016 13:37:14 +0300 Subject: [PATCH] updating --- lab13/2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; }