Turn on a implicit-function-declaration warning by default.
[tinycc.git] / win32 / examples / fib.c
blob8da26bce690f0002603eef7af0f06b25879b5ff2
1 #include <stdio.h>
2 #include <stdlib.h> // atoi()
4 int fib(n)
6 if (n <= 2)
7 return 1;
8 else
9 return fib(n-1) + fib(n-2);
12 int main(int argc, char **argv)
14 int n;
15 if (argc < 2) {
16 printf("usage: fib n\n"
17 "Compute nth Fibonacci number\n");
18 return 1;
21 n = atoi(argv[1]);
22 printf("fib(%d) = %d\n", n, fib(n));
23 return 0;