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


Please Help Members By Posting Answers For Below Questions

What is the types of inheritance?

813


What is abstract class in oop?

749


Why do we use inheritance?

825


How can you overcome the diamond problem in inheritance?

962


What is cohesion in oop?

843


just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.

6708


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

1804


Why is there no multiple inheritance?

771


Why is oop useful?

817


What is static in oop?

831


What is abstract class in oops?

777


How many human genes are polymorphic?

792


Why multiple inheritance is not possible?

799


What do you mean by Encapsulation?

809


How do you define a class in oop?

856