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