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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
Answer / deepanker aggarwal
the answer is 3 because x is not initialised and it may
contain any garbage value
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / rakesh
the output is undefined
because c++ do not implicitly initialised the varible. it
gives garbage value for uninitialized variables
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ibrazileasum
The initial value of x is not defined to '0' hence the complier will not start from 0 as initial value. This is a garbage error to the compiler
| Is This Answer Correct ? | 0 Yes | 0 No |
Contrast OOP and SOA. What are tenets of each?
1 Answers Siebel Systems, Wipro,
Can we create object of interface?
What is the point of polymorphism?
What does oop mean in snapchat?
How do you achieve runtime polymorphism?
What is class in oop with example?
what type of questions
Can we have a private virtual method ?
How do you define social class?
1.what are two type of classe members called? 2.what is data hiding and data encapsulation? 3.how do you make a class member visible aouside its class? 4.what is the default visibility of a class data member? 5.what are the advantages of oop over the structured programing?
What are the benefits of oop?
What is difference between #define and const?