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 programe to calculate the simple intrest and compund intrest using by function overlading
How does polymorphism work?
What is inheritance write a program to show use of inheritance?
What is inheritance and how many types of inheritance?
hi all..i want to know oops concepts clearly can any1 explain??
What is oops with example?
What does I oop mean?
what is graphics
What is overriding in oop?
What does enum stand for?
How do you define a class in oop?
Prepare me a program for the animation of train
What is difference between multiple inheritance and multilevel inheritance?
Why multiple inheritance is not possible?
What is overriding in oops?