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 / 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 |
Post New Answer View All Answers
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What is an advantage of polymorphism?
What are the components of marker interface?
Why we use classes in oop?
Whats is abstraction in oops?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
What is the real time example of encapsulation?
What is the diamond problem in inheritance?
why reinterpret cast is considered dangerous?
What is object-oriented programming? Webopedia definition
What is byval and byref? What are differences between them?
What is destructor give example?
Why is static class not inherited?
What do you mean by variable?
What is the difference between encapsulation and polymorphism?