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 / raju

ans 0

first it return value ofter that it increment

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can main method override?

583


What language is oop?

593


What is object in oop?

679


How oops is better than procedural?

585


How many human genes are polymorphic?

570






What are two types of polymorphism?

611


what are the ways in which a constructors can be called?

1581


Why multiple inheritance is not allowed?

581


What are the 3 principles of oop?

619


What is a class and object?

598


What is abstraction and encapsulation?

570


What is difference between oop and pop?

613


INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?

1634


What do you mean by abstraction?

613


What is the purpose of polymorphism?

678