Fibonacci series Program Using C

About Fibonacci Series Program in C:

Definition: A series of numbers in which each number ( Fibonacci number ) is the sum of the two preceding numbers. The simplest is the series 1, 1, 2, 3, 5, 8, etc.


#include<stdio.h>
void main()
{
int n,i,a=0,b=1,sum=0;
printf(“Enter limit :”);
scanf(“%d”,&n);
for(i=1;i<=n;i++)
{
printf(“%d\t”,a);
sum=a+b;
a=b;
b=sum;
}
}

Share this