What will happen when the following code is run: int x; while(x<100) { cout<

  1. The computer will output "0123...99"

  2. The computer will output "0123...100"

  3. The output is undefined

  4. Don't know


Correct Option: C

AI Explanation

To answer this question, you need to understand how the code snippet works.

The code snippet initializes an integer variable x without assigning it a value. In C++, uninitialized variables have an undefined value. Therefore, the initial value of x is unknown.

Next, the code enters a while loop that continues as long as x is less than 100. Inside the loop, the code prints the value of x using `cout<

Find more quizzes: