Fibonacci Program

I have this Fibonacci program due this Friday. I can't figure out what to put into the for loop to find the term requested by user. Here is what the program should do:
What term would you like to see?
4
The term you requested is 3. Thanks.
Press any key to continue...

Here is my code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>

using namespace std;
int main()
{
    int Term = 0;
    int Fibonacci = 0;
    int TermRequest = 0;
    int Number1 = 0;
    int Number2 = 0;
    
    cout << "What term do you want to see: ";
    cin >> Term;
    
    for(int x = 0; x > 0; x++)
    {
            
    }
    
    cout << "The term you request is " << Request << endl << endl;
    
    system("PAUSE");
    return 0;
}
To be honest it is kind of pointless to just give you the answer instead I'll try and set you on the right mind set.

First of all you need to know how the Fibonacci sequence works. Try writing it down every step that is taken to understand the algorithm.

Do this for the first 4-5 numbers after you do that replace numbers with symbols and eventually you'll see it all links together from each sequence.


Oh and this can also be done using recursion if you understand that concept.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>
using namespace std;

int main () {
	int temp;
	int num1 = 0;
	int num2 = 1;
	int count = 0;
   cout << "Enter in the number of iterations for the" 
		<< " fibonacci sequence\n"; 
	cin >> count;
	if (count == 1) {
		cout << 0;
	}
	cout << 0 << ", ";
	for (int i = 1; i < count; i++) {
		temp = num1+num2;  //swap procedure 
		num1 = num2;
		num2 = temp;
		cout << num1 << ", ";
	}
	
	
    return 0;
}


sorry about how poorly this is written I have to go to work in a minute, but this is a working program and should adequately show you how the fibonacci formula really works.
Topic archived. No new replies allowed.