C program to display the Fibonacci Series

Contents

Explanation

The Fibonacci series are integer sequence of 0,1,1,2,3,5,8…..The first two numbers in the series are 0 and 1.The subsequent numbers are generates by adding the two previous numbers.

Solution

Example : 0,1,1,2,3,5,8…

first number = 0

second number = 1

third number = first number + second number => 1

Fourth number = third number + second number =>2

Fibo(n) = Fibo(n-1) + Fibo(n-2)

Program

#include
int main()
{
    int first=0,second=1,next,n,i;
    printf("Enter the number of terms for Fibonacci Series:\n");
    scanf("%d",&n);

    printf("The first %d terms of Fibonacci Series are:\n",n);
    for(i=0;i



Output