What will be printed out as a result of the following code's execution?
int x;
while(x < 100) {
    cout << x << " ";
C++ does not initialize POD (Plain Old Data) variables defined on the stack. Variable x that is located on the stack can take an arbitrary value, since it was not initialized during its definition. Therefore, the loop can be executed any number of times.
C++ Quiz
Start Quiz

or Read more about C++ Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback