by Anonymous on January 5th, 2008

Anonymous

Question

Help answer this question below.

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




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


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


3) The output is undefined

  • Like
  • Report

Answers. 1 helpful answer below.

  • by Anonymous on January 17th, 2008

    Anonymous

    No 1: 0123...9899

    int x; //int is initialised to 0, by default

Want to attach an image to your answer? Click here.

Did this answer your question? If not, then ask a new question or create a poll.

You're reading What will happen when the following code is run: int x; while(x<100) { cout<<x; x++; } 1) The computer will output "0123...99" 2) The computer will output "0123...100" 3) The output is undefined

Follow us on Facebook!

Related Ads

ANSWERBAG BUZZ

What will happen when the following code is run int x while x 100 cout x x the computer will output 0123 99 the computer will output 0123 100 the output is undefined
What will happen when the following code is run int x while x 100 cout x x
What will happen int x while x 100 cout x x