Skip to content

Instantly share code, notes, and snippets.

@davidad
Created April 14, 2014 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidad/10678998 to your computer and use it in GitHub Desktop.
Save davidad/10678998 to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#include <stdio.h>
extern unsigned long fib(unsigned long);
int main(int argc, char* argv[]) {
if(argc<2) printf("usage: fib_test <integer>\n"), exit(1);
unsigned long input = strtoul(argv[1],NULL,10); // string to unsigned long
printf("fib(%lu) = %lu\n",input,fib(input));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment