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 / aravind
In most of the compilers now all declared variables are
usually initialised with 0. So in most compilers result
would be #1. But in some cases the garbage values may creep
up.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is difference between abstraction and encapsulation?
Why is polymorphism needed?
What is polymorphism and why is it important?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
What are the 4 main oop principles?
What is variable example?
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
What exactly is polymorphism?
Why multiple inheritance is not possible?
What is basic concept of oop?
Can we override main method?
What is abstraction example?
What are the advantages of polymorphism?
Is abstract thinking intelligence?