Program to find Factorial of a Number using Recursion
Program to print Fibonacci Series using Recursion
A Fibonacci series is defined as a series in which each number is the sum of the previous two numbers with 1, 1 being the first two elements of the series.
static keyword is used to initialize the variables only once.
Below is a program to print the fibonacci series using recursion.
Source code:
Show More#include
// declaring the function
void printFibo(int );
int main()
{
int k, n;
long int i = 0, j = 1;
printf("Enter the length of the Fibonacci series: ");
scanf("%d", &n);
printf("\n\nfirst %d terms of Fibonacci series are:\n\n\n",n);
printf("%d ", 1);
printFibo(n);
return 0;
}
void printFibo(int aj)
{
static long int first = 0, second = 1, sum;....
All Chapters — C programming
Similar Questions
From Recursive program in c · C programming
C Program to Find whether a Number is Prime or Not using Recursion
C Program to find whether a Number is Prime Or Composite using Recursion
C Program to Find Product of 2 Numbers using Recursion
C Program to find LCM of two Numbers using Recursion
C Program to Find Sum of N Numbers using Recursion
C Program to calculate a Number raised to the Power of N using Recursion
C Program to find GCD of two Numbers using Recursion