Program to print Fibonacci series
up to 100.
Fibonacci series is in the form of 0, 1, 1, 2, 3, 5, 8, 13, 21,...... To find Fibonacci series you need to add two previous terms/digits and get next term/number.

#include<stdio.h>
#include<conio.h>
void main()
{
int a=1,b=1,c=0,i;
clrscr();
printf("%d %d ",a,b);
for(i=0;i<=10;i++)
{
c=a+b;
if(c<100)
{
printf("%d ",c);
}
a=b;
b=c;
}
getch();
}
Output:
1 1 2 3 5 8 13 21 34 55 89

0 Comments