Wednesday, 20 February 2013
Fibbonacci program using Function
//Fibbonacci program using Function
void fibbo(int);
void main()
{
clrscr();
fibbo(50);
getch();
}
void fibbo(int n)
{
int a=0,b=1,c;
int i;
printf("%d\t%d\t",a,b);
for(i=0;i<n-2;i++)
{
c=a+b;
a=b;
b=c;
printf("%d\t",c);
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment