What is the output of the following code:
int v()
{
int m=0;
return m++;
}
int main()
{
cout<<v();
}
1) 1
2) 0
3) Code cannot compile
Answer Posted / shailaja
the output of this code is
0
bcz here the return statement it will stops the execution
and returns to the calling function.
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What is class encapsulation?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
i got a backdoor offer in process global,Bangalore..Can i work with it?
What is polymorphism explain its types?
Can we override main method?
What is inheritance and how many types of inheritance?
What are the data types in oop?
What is interface? When and where is it used?
What causes polymorphism?
What does sksksk mean in text slang?
write a C++ program for booking using constructor and destructor.
Prepare me a program for the animation of train
What is the significance of classes in oop?
when to use 'mutable' keyword and when to use 'const cast' in c++