big trouble in little program
I keep getting an infinate loop for some reason and I cannot figure out why. This is a Fibonacci program that is a large pain in my ass. I need to add a print function aswell but I am not sure how to go about it. Any ideas. Here is my program.
scanf("%d",&b);
c=cal_fibonacci(b);
}
int cal_fibonacci (int d)
{
int f1;
int f2;
int fnew, temp;
int x;
for(x=1;x<d;++x)
{
while (x<3)
{
printf("%d" "1",x);
printf("F1=1");
printf("F2=1");
}
fnew=f1+f2;
printf("%d" "%d",x,fnew);
f1=temp;
f2=f1;
f2=fnew;
}
}