The program needs to ask for n and then output the first n terms of the Fibonacci sequence.
exp.
n = 6
1, 1, 2, 3, 5, 8
1+1 =2
2+1=3
3+2=5
5+3=8
My origional program used a nested for loop.
I am not sure if that is right to use in this type a situation.
I would like suggestions to make it work.
#include <iostream>
using namespace std;
int main ()
{
int fOne = 1;
int fTwo = 1;
int fThree = 2;
long fN;
long fNN;
cout << "How many n terms do you want in the sequence: ";
cin >> fN;
for ( fN = 1 ; fN >= 3 ; fN++ )
{
for (fNN = 1; fNN >= fN; fNN++)
fNN = (fN - 1) + (fN - 2);
cout << fN;
}
}