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 / 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 |
Post New Answer View All Answers
What is encapsulation with example?
What type of loop is a for loop?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< Why is there no multiple inheritance? Why can't we have instance(stack) of a class as a member of
the same class like eg.Class A{A obj;} as we can have self
refential pointer What is the purpose of enum? Get me an image implementation program. Why do we need polymorphism in c#? Is abstract thinking intelligence? What is super in oop? How can you overcome the diamond problem in inheritance? What is the highest level of cohesion? What polymorphism means? What are oops methods? write a program to enter a string like"sunil is a good boy
and seeking for a job" not more than 10 characters including
space in one line,rest characters should b in other line.if
the next line starts from in between the previous word,then
print whole word to next line.