Maybe this should be in the beginner forum but I'm trying to make a fibonacci sequence with some user inputs. I'm using arrays for this, the user inputs are for the Nth term and the starting number (as in the number in front of 0).
My problem is that when the program runs it's an infinite loop which constantly prints the starting number. Which, I think, means that my WHILE loop isn't coming to an end and my 'count' variable isn't increasing. Sorry to bother you guys, does anyone know what I've done wrong?
On line 15, it is not allowed by the C++ standard to declare an array from a non-const number like this. SOme compilers support it, but you should get out of this habit and use an STL container or dynamic memory (whichever is allowed, preferably STL containers).
Between line 18 where you declare comp and line 23 where you use it, you never initialize comp. Can't you just do a for loop or make the while condition while count < term?
On line 25, you increment count, but on line 26 you decrement it again. Maybe you mean count-1 and not count--?
This is typically a problem on Windows, caused by really dumb IDEs that don't know enough to keep the console open after the program finishes. However, it does strike right at one of the main philosophical problems with the way you are thinking about programming. After all, a console program should be run from the console --else once it terminates, the console should disappear