WAP to display the given series: 1,1,2,3,5,8,13,21,34,55............. up to 15th terms. It is a series which is called 'Fibonacci'. In fibonacci series first(starting) two numbers are added to get the third number. and this continues till the last term.
Here is an example C program for finding 'Fibonacci' series.
#include<stdio.h>
#include<conio.h>
int main()
{
int i, a,b,c;
a=1;
b=1;
printf("Fibonacci Series\n");
for(i=1;i<=15;i++)
{
printf("%d\n",a);
c=a+b;
a=b;
b=c;
}
getch();
}
Here is an example C program for finding 'Fibonacci' series.
#include<stdio.h>
#include<conio.h>
int main()
{
int i, a,b,c;
a=1;
b=1;
printf("Fibonacci Series\n");
for(i=1;i<=15;i++)
{
printf("%d\n",a);
c=a+b;
a=b;
b=c;
}
getch();
}