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

Answer Posted / ibrazileasum

The initial value of x is not defined to '0' hence the complier will not start from 0 as initial value. This is a garbage error to the compiler

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is overloading and its types?

604


How do you define a class in oop?

613


What is polymorphism programming?

593


What are the two different types of polymorphism?

664


Which is not an object oriented programming language?

530






write a program to find 2 power of a 5digit number with out using big int and exponent ?

1881


What is the real time example of inheritance?

629


Where is pseudocode used?

555


What is encapsulation example?

541


What is the example of polymorphism?

550


What is overriding in oops?

592


What is an advantage of polymorphism?

583


Which is better struts or spring?

608


What is solid in oops?

592


What is the significance of classes in oop?

581