
eu.mihosoft.vtcc.tccdist.windows.x64.tcc.examples.fib.c Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tcc-dist Show documentation
Show all versions of tcc-dist Show documentation
Precompiled TCC distribution for Java projects and VMF/VRL plugins
The newest version!
#include
#include // atoi()
int fib(n)
{
if (n <= 2)
return 1;
else
return fib(n-1) + fib(n-2);
}
int main(int argc, char **argv)
{
int n;
if (argc < 2) {
printf("usage: fib n\n"
"Compute nth Fibonacci number\n");
return 1;
}
n = atoi(argv[1]);
printf("fib(%d) = %d\n", n, fib(n));
return 0;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy