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 / d n gavade

The Answer is 3)The Output is undefined because x is not
initialised and its datatype is auto int so that its inital
value will be garbage.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is coupling in oops?

824


What is byval and byref? What are differences between them?

1952


Why we use classes in oop?

773


What is ambiguity in inheritance?

848


How oops is better than procedural?

830


Why do we use class in oops?

744


What is polymorphism used for?

772


Is data hiding and abstraction same?

771


write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.

1990


What are properties in oop?

808


What is destructor in oop?

794


Describe these concepts: Polymorphism, Inheritance and Abstraction.

868


Can bst contain duplicates?

943


write string class as your own class in java without using any built-in function

2210


Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)

3829