My while loop doesn't stop, why?

Jun 30, 2014 at 1:58am
A friend of mine tested this code and it works properly and also stops when it should. I'm using codeblocks with mingw. Could it be my compiler or does anyone know what is happening?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>

using namespace std;

int main()
{
    int variable = 0;

    while (variable < 5000)
    {
        variable++ ;
        cout << variable << endl ;
    }
return 0;
}


http://i.imgur.com/mW8IAmL.jpg
Jun 30, 2014 at 2:00am
It has to be your compiler. Even the C++ shell on this website has it be completely functional. Try building it again.
Jun 30, 2014 at 2:36am
Oh, rebuilding it worked.
Topic archived. No new replies allowed.