C Programming Code Examples C > Recursion Code Examples Program to display Fibonacci series using recursion Program to display Fibonacci series using recursion Here we are using a user defined function fibonacci_series() that calls itself recursively, in order to display series for the entered number of terms. #include<stdio.h> int fibonacci_series(int); int main() { int count, c = 0, x; printf("Enter number of terms:"); scanf("%d",&count); printf("\nFibonacci series:\n"); for ( x = 1 ; x <= count ; x++ ) { printf("%d\n", fibonacci_series(c)); c++; } return 0; } int fibonacci_series(int j) { if ( j == 0 ) return 0; else if ( j == 1 ) return 1; else return ( fibonacci_series(j-1) + fibonacci_series(j-2) ); }