c program to print fibonacci seriesint fibolong


C program to print fibonacci series:

int fibo(long int);

void main()

{

                long int a=0,n;

                printf ("how many terms\n");

                scanf("%d",&n);

                for(int i=1;i<=n;i++)

                {a=fibo(i);

                printf("%d ",a);

                }

}

fibo(long int m)

{

                long int x;

                if(m>2)

                {

                x=fibo(m-1)+fibo(m-2);

                return x;

                }

                else if(m==2)

                                return 1;

                else if(m==1)

                {return 0;}

}

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: c program to print fibonacci seriesint fibolong
Reference No:- TGS0162089

Expected delivery within 24 Hours