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
Write a program to sort the number with different sorts in one program ??
How do you achieve runtime polymorphism?
which feature are not hold visual basic of 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 do you mean by abstraction?
What is the purpose of polymorphism?
Can a destructor be called directly?
How do you achieve polymorphism?
What is a class and object?
What is static modifier?
Get me a number puzzle game-program
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
Get me an image implementation program.
What is solid in oops?
What are the benefits of interface?