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 / nk
Output is undefined because initially variable 'x' is not
initialized and may contain some garbage value.
However if we initialize 'x' to 0 then choice#1 is correct.
Is This Answer Correct ? | 13 Yes | 0 No |
Post New Answer View All Answers
What is encapsulation process?
#include
can inline function declare in private part of class?
What are properties in oop?
Can we create object of interface?
What is the difference between procedural programming and oops?
What is abstraction 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?
What does sksksk mean in text slang?
Is enum a class?
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
Are polymorphisms mutations?
What is difference between oop and pop?
which feature are not hold visual basic of oop?
What is coupling in oops?