Fibonacci series

24/07/2013 ·

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


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 with seed values[1]


The Fibonacci sequence is named after Leonardo of Pisa, who was known as Fibonacci.



/*C Program for generate Fibonacci series*/
#include "stdio.h" #include "conio.h" void main() { int a,b,c,i,n; clrscr(); a=0; b=1; printf("\n enter n for how many times generate series"); scanf("%d",&n); printf("\n FIBONACCI SERIES\n"); printf("\t%d\t%d",a,b); for(i=0;i<n;i++) { c=a+b; a=b; b=c; printf("\t%d",c); } getch(); }


input:12
output: FIBONACCI SERIES
0 1 1 2 3 5 8 13 21 34 55 89

0 comments:

Post a Comment

Submit Request

If you need some code or programs just post a comment on this post. I will try to provide you the same at the earliest.

About this blog

Free sample code, example code , code snippet , tutorials in C C++. Find, download and reuse the code database available which vary from small programs to large ones as well. Feel free to request for code that is not in the list.

Followers