Fibonacci was an Italian scientist who created the Fibonacci sequence
It a sequence of numbers beginning with 0 and 1 where each number is the sum of the two preceeding numbers. F1 = 0 F2 = 1 F3 = F2 + F1 = 1 + 0 = 1 F4 = F3 + F2 = 1 + 1 = 2 F5 = F4 + F3 = 2 + 1 = 3 F6 = F5 + F4 = 3 + 2 = 5 etc.
Fibonacci was an Italian scientist who created the Fibonacci sequence
The Fibanacci sequence is defined in terms of its first two numbers which are arbitrary. If I choose the first two numbers to be 1 and 1, then the first non-Fibanacci number is 4. But I could chose the first two numbers to be 2 and 2. In which case 1 would be the smallest non-Fibonacci number.
It a sequence of numbers beginning with 0 and 1 where each number is the sum of the two preceeding numbers. F1 = 0 F2 = 1 F3 = F2 + F1 = 1 + 0 = 1 F4 = F3 + F2 = 1 + 1 = 2 F5 = F4 + F3 = 2 + 1 = 3 F6 = F5 + F4 = 3 + 2 = 5 etc.
#include<stdio.h> #include<conio.h> main() { int a=0,b=1,c,i,n; clrscr(); printf("enter the limit of series\n"); scanf("%d",&n); if(n==0) printf("%d\n",a); else printf("%d\n%d\n",a,b); for(i=2;i<=n;i++) { c=a+b; printf("%d\n",c); a=b; b=c; } getch(); }