Skip to content
Permalink
bc4cf004c6
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
18 lines (14 sloc) 339 Bytes
#include<stdio.h>
#include<stdlib.h>
#include<inttypes.h>
uint64_t fibonacci(uint64_t n)
{
if (n == 2 || n == 1) return 1;
return fibonacci(n-1) + fibonacci(n-2);
}
int main(int argc, char** argv)
{
uint64_t n = strtoull(argv[1], NULL, 0);
printf("Fibonacci(%" PRIu64 ") = %" PRIu64 "\n", n, fibonacci(n));
return EXIT_SUCCESS;
}