|
---|
|
---|
|
---|
C Program For FIBANACCI SERIES USING RECURSION.
void main()
{
int i,n;
clrscr();
printf("Enter the n value:");
scanf("%d",&n);
printf("the fibinacci series is\n");
for(i=0;i
{
printf("%d\n",fib(i));
}
getch();
}
int fib(int n)
{
if(n==0)
{
return(0);
}
if(n==1)
{
return(1);
}
else
{
return(fib(n-1)+fib(n-2));
}
}
|
---|