Skip to content

Instantly share code, notes, and snippets.

@rahulkmr
Created February 7, 2010 07:17
Show Gist options
  • Save rahulkmr/297269 to your computer and use it in GitHub Desktop.
Save rahulkmr/297269 to your computer and use it in GitHub Desktop.
#include <stdio.h>
double fib(int num)
{
if (num <= 1)
return 1;
else
return fib(num-1) + fib(num-2);
}
int main(int argc, char *argv[])
{
printf("%.0f\n", fib(atoi(argv[1])));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment