C program to generate Fibbonacci series
#include <stdio.h>
#include <conio.h>
void main()
{
int a=0;
int b=1;
int c=0;
int i;
int n;
clrscr();
printf("Enter the total number range of series : ");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
printf("%d ",c);
a=b;
b=c;
c=a+b;
}
getch();
}
Output :

0 comments:
Post a Comment