Created
December 31, 2014 09:29
-
-
Save arn-ob/024938fd8c05a0c060b0 to your computer and use it in GitHub Desktop.
Ftbonacei Series ... 0 2 2 4 6 10 16 26 42 60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int fib(int n) | |
{ | |
if(n==0) | |
return 0; | |
else if (n==1) | |
return 1; | |
else | |
return fib(n-1)+fib(n-2); | |
} | |
void main() | |
{ | |
int x,y,i; | |
printf("How many nu number you wanted to see : "); | |
scanf("%d",&x); | |
for(i=0;i<=x;i++) | |
{ | |
y=2*fib(i); | |
printf(" %d ",y); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment