Fibonacci Series in c


Basic Concept Behind Fibonacci series :-

In mathematics, the Fibonacci numbers or Fibonacci series or Fibonacci sequence are the numbers in the following integer sequence:
0,\;1,\;1,\;2,\;3,\;5,\;8,\;13,\;21,\;34,\;55,\;89,\;144,\; \ldots\;

By definition, the first two numbers in the Fibonacci sequence are 0 and 1, and each subsequent number is the sum of the previous two.
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation
F_n = F_{n-1} + F_{n-2},\!\,
with seed values[
F_0 = 0,\; F_1     = 1.





C program implementation of Fibonacci Series

#include<stdio.h>
#include<conio.h>
void main()
{
int a=0,b=1,c,i,n;
clrscr();
printf("Enter no of term:");
scanf("%d",&n);
printf("Fibonoci Series:\n");
printf("%d\n\n",a);
printf("%d\n\n",b);
for(i=0;i<n;i++)
{
c=a+b;
a=b;
b=c;
printf("%d\n\n",c);
}
getch();
}



Comments

Popular posts from this blog

Tips 01) self introduction in an interview

Computer Science Terminology

Why Failure Is Good for Success