Ads 468x60px

Labels

Jun 7, 2012

#4 - Fibonacci Series [C]

#include"stdio.h"
#include"math.h"
void main()
{
int i,n,f=-1,s=1,t;
printf("Enter the value \n");
scanf("%d",&n);
i=1;
while(i<=n)
{
t=f+s;
prinf("\n The result is %d",t);
i=i+1;
f=s;
s=t;
}
getch();
}

No comments:

Post a Comment