- Fibonacci Series is the Series in which Next Number is Sum of Previous Two Numbers.
- Example: 0 1 1 2 3 5 8 13 21 34 ............and so on.
#include<stdio.h>
#include<conio.h>
int a,b,c;
clrscr();
clrscr();
a=0;
b=1;
while(a<=100)
{
printf("\n%d" ,a);
c=a+b;
a=b;
b=c;
}
getch();
}
Output:
0
1
1
2
3
5
8
13
21
No comments:
Post a Comment