Hi Everyone!
I'm a user of Turbo C++ and my professor gave me an activity to make a Fibonacci sequence.
No I already have the Code for it and it is working. The only problem is. I don't know how the FOrmula Works.
I will show you the Code below:
include<stdio.h>
include<conio.h>
int x, num, f0 = 0, f1 = 1, fibo;
main()
{
clrscr();
printf("Enter a number: ");
scanf("%i",&num);
for (x=0;x<num;x++) {
//fibo means fibonacci.
fibo = f0+f1, f0=f1, f1=fibo;
printf(" %i",fibo);
}
getch();
}
IF you can just tell me how this FOrmula works: fibo = f0+f1, f0=f1, f1=fibo; That would be really great.
You guys can just reply to this thread or Email me the explanation: [nope]
Thank you! :D