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
Can static class have constructor?
Explain virtual inheritance?
What does and I oop mean?
Can a destructor be called directly?
Why is polymorphism important in oop?
What is and I oop mean?
Why do we use polymorphism in oops?
What is encapsulation with real life example?
Can you explain polymorphism?
What is difference between multiple inheritance and multilevel inheritance?
Write a program to sort the number with different sorts in one program ??
Is oop better than procedural?
What is pure oop?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
is there any choice in opting subjects like 4 out of 7