Fibonacci series Program ( C implementation )

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,...

#include 
#include
void main(){
printf(" Fibonacci series \n ");
int prev=0;
int current=1;
int fibo;
int i;
for(i=1;i<15;i++)
{
fibo=prev+current;
printf("%d \n",fibo);
prev=current;
current=fibo;
}                            
}

OUTPUT

No comments:

Post a Comment