Chapter:

Recursive-program-in-c

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:

#include<stdio.h>

// 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);

 &....

Show More

All Chapters

View all Chapter and number of question available From each chapter from C-programming-