C program print Fibonacci series using recursion only (without any loop structre)

C program for Fibonacci series using  only recursion if you face any difficulty to understand code or concept please comment below:-



#include<stdio.h>

int fs(int x,int y,int l)

{int c;

    if(1<=l){

{
printf(" %d\n",x);
c=x+y;
x=y;
y=c;
l--;
fs(x,y,l);

}

}}
int main()
{int l;
    printf("Enter total number you want to print : ");scanf("%d",&l);
fs(0,1,l);

}

//need help or mod comment below

0 Comments