Hello everybody. I am beginner in programming.....However, recently i recieved a simple assigment from my Professor. The assigment asks me to use C++ and create a programe that will display a series of Fabonacci numbers after the user enter a number . For example if the user enter 10 , then on the screen it will display " 0 1 1 2 3 5 8 13 21 34 " . That the 3rd number equals 1st number plus 2nd number. Anyways, when i starts debugging , the window always disapears after i type in a number after the question "How many series of Fabonacci numbers do you want to see?" I know that my codes are not right...but i just can't go on if the window keeps disapearing on me...Would some one please help me...
(!) I have already fixed all the pop-up syntax errors
#include<iostream>
using namespace std;
void main()
{
int Num1=0;
int Num2=1;
int Sum;
int Usernum;
int Count=1;
cout << "How many Fibonacci series numbers do you want to see??"" ";
cin >> Usernum;
while( Count < Usernum)
{
cout << Num1 <<" ";
Sum = Num2 + Num1;
Num1 = Num2;
Num2 = Sum;
Count = Count + 1;
}
}