You are saying "at the end of the program", but I have trouble believing that program would ever terminate; it should get stuck in an infinite loop. I believe line 12 is an error, but it's hard to tell (Do you want to use the comparison operator, == ?). Even if you did, it should still infinite loop, because you never modify no inside the while loop.
The program will jump into infinite loop due to the while statement at line 12. and the reason u see the value of crash shows up as 0 is because the program keep multiplied the crash in the infinite loop and the value of crash become bigger and bigger and finally become 0. (to represent infinity i think)..
So, the problem arise at while statement at line 12..
If you keep multiplying an integer by two (effectively bit shifting left) you will eventually end up with no bits set in your integer (ie zero), from there on you will only get zero out.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
usingnamespace std;
int main(int argc, char *argv[])
{
int number = 1;
for(int i = 1; i < 35; ++i)
{
cout << i << "\t" << number << endl;
number *=2;
}
return EXIT_SUCCESS;
}