Skip to content
Permalink
285c2f517d
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
Latest commit 285c2f5 Mar 26, 2019 History
1 contributor

Users who have contributed to this file

25 lines (14 sloc) 329 Bytes
#include <stdio.h>
int fibonacci(int n)
{
if(n==0) return 0;
if(n==1) return 1;
return fibonacci(n - 1) + fibonacci(n - 2);
}
int main(void)
{
int n;
printf("Enter a number between 1 and 10:");
scanf("%d",&n);
printf("Fibonacci(n)=%d\n",fibonacci(n));
}