i need help with this code.
when i enter a number i want to see the sequence always give 2 extra number. the two extra numbers are 0 and 1 but i need it to be included
so if i wanted to see 10 numbers
it would show: 0 1 1 2 3 5 8 13 21 34 55 89
but i need it to show:
0 1 1 2 3 5 8 13 21 34
#include <iostream>
using namespace std;
int main (int argc, char* argv[])
{
int fib1 = 0;
int fib2 = 1;
int fib3;
int numbers;
cout<<"How many numbers would you like to see?";
cin >> numbers;
if (numbers < 2)
cout <<"The number has to be bigger than ";
if (numbers >= 2);
cout<<fib1<<endl<<fib2<<endl;
int count;
for (count = 1; count <= numbers; count = count + 1)
{
fib3 = fib1 + fib2;
cout << fib3 <<endl;
fib1 = fib2;
fib2 = fib3;
}
system("pause");
return 0;
}