Monday, 3 February 2014

Programm to find fibonacci series

Fabonacci Series

#include<stdio.h>
#include<conio.h>
Void main()
{
long int n,first=0,second=1;next,c=1;
Clrscr();
Printf(“Enter the number: “);
Scanf(“%ld”,&n);
While(c<n)
{
next=first+second;
first=second;
second=next;
Printf(“%ld\n”,next);
c++;
}
getch();
}

No comments:

Post a Comment